Skip to content

Commit

Permalink
Merge pull request #40 from niladrih/no-bdc
Browse files Browse the repository at this point in the history
cherry-pick(pre-upgrade): Removed error return when no BDC is found for a PV
  • Loading branch information
niladrih committed Apr 6, 2021
2 parents a05c6ec + 18d3585 commit ffbcc36
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/provisioner-localpv/app/backward_compatability.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
mconfig "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/klog"
)

// This function performs the preupgrade related tasks for 1.0 to 1.1
Expand All @@ -48,7 +49,12 @@ func addLocalPVFinalizerOnAssociatedBDCs(kubeClient *clientset.Clientset) error
bdcObj, err := blockdeviceclaim.NewKubeClient().WithNamespace(getOpenEBSNamespace()).
Get(bdcName, metav1.GetOptions{})
if err != nil {
return errors.Wrapf(err, "failed to get bdc %v", bdcName)
// BDCs may not exist if the PV reclaimPolicy is set
// to 'Retain' and the BDCs have been manually removed
// Ref: github.com/openebs/openebs/issues/3363
// TODO: Clean this part of the code up a bit.
klog.Warningf("failed to get bdc %v", bdcName)
continue
}

// Add finalizer only if deletionTimestamp is not set
Expand Down

0 comments on commit ffbcc36

Please sign in to comment.