Merge pull request #84844 from leakingtapan/ebs-migration

Fix migration tranlation library for ebs
This commit is contained in:
Kubernetes Prow Robot 2019-11-07 04:36:41 -08:00 committed by GitHub
commit 05f66b38fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,10 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeInlineVolumeToCSI(vol
return nil, fmt.Errorf("volume is nil or AWS EBS not defined on volume")
}
ebsSource := volume.AWSElasticBlockStore
volumeHandle, err := KubernetesVolumeIDToEBSVolumeID(ebsSource.VolumeID)
if err != nil {
return nil, fmt.Errorf("failed to translate Kubernetes ID to EBS Volume ID %v", err)
}
pv := &v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
// A.K.A InnerVolumeSpecName required to match for Unmount
@ -66,7 +70,7 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeInlineVolumeToCSI(vol
PersistentVolumeSource: v1.PersistentVolumeSource{
CSI: &v1.CSIPersistentVolumeSource{
Driver: AWSEBSDriverName,
VolumeHandle: ebsSource.VolumeID,
VolumeHandle: volumeHandle,
ReadOnly: ebsSource.ReadOnly,
FSType: ebsSource.FSType,
VolumeAttributes: map[string]string{