mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Fix migration tranlation library for ebs
This commit is contained in:
parent
0c0408c790
commit
dd4b21e137
@ -57,6 +57,10 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeInlineVolumeToCSI(vol
|
|||||||
return nil, fmt.Errorf("volume is nil or AWS EBS not defined on volume")
|
return nil, fmt.Errorf("volume is nil or AWS EBS not defined on volume")
|
||||||
}
|
}
|
||||||
ebsSource := volume.AWSElasticBlockStore
|
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{
|
pv := &v1.PersistentVolume{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
// A.K.A InnerVolumeSpecName required to match for Unmount
|
// A.K.A InnerVolumeSpecName required to match for Unmount
|
||||||
@ -66,7 +70,7 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeInlineVolumeToCSI(vol
|
|||||||
PersistentVolumeSource: v1.PersistentVolumeSource{
|
PersistentVolumeSource: v1.PersistentVolumeSource{
|
||||||
CSI: &v1.CSIPersistentVolumeSource{
|
CSI: &v1.CSIPersistentVolumeSource{
|
||||||
Driver: AWSEBSDriverName,
|
Driver: AWSEBSDriverName,
|
||||||
VolumeHandle: ebsSource.VolumeID,
|
VolumeHandle: volumeHandle,
|
||||||
ReadOnly: ebsSource.ReadOnly,
|
ReadOnly: ebsSource.ReadOnly,
|
||||||
FSType: ebsSource.FSType,
|
FSType: ebsSource.FSType,
|
||||||
VolumeAttributes: map[string]string{
|
VolumeAttributes: map[string]string{
|
||||||
|
Loading…
Reference in New Issue
Block a user