pb3206: Not returning error if the storageclass is missing on destination cluster
@@ -2621,8 +2621,9 @@ func (p *portworx) UpdateMigratedPersistentVolumeSpec(
if len(pv.Spec.StorageClassName) != 0 {
sc, err := storage.Instance().GetStorageClass(pv.Spec.StorageClassName)
if err != nil {
- return nil, fmt.Errorf("failed in getting the storage class [%v]: %v", pv.Spec.StorageClassName, err)
+ logrus.Warnf("failed in getting the storage class [%v]: %v", pv.Spec.StorageClassName, err)
}
+ if sc != nil {
if isCsiProvisioner(sc.Provisioner) {
// add csi section in the pv spec
if pv.Spec.CSI == nil {
@@ -2684,6 +2685,7 @@ func (p *portworx) UpdateMigratedPersistentVolumeSpec(
pv.Spec.PortworxVolume = nil
}
}
+ }
if pv.Spec.CSI != nil {
pv.Spec.CSI.VolumeHandle = pv.Name
