Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(migration): add snapshot migration support for cstor #10

Merged
merged 4 commits into from
Jun 12, 2020

Conversation

shubham14bajpai
Copy link
Contributor

This PR adds support for migrating snapshots from volumesnapshot.external-storage.k8s.io/v1 to snapshot.storage.k8s.io/v1beta1 spec.

Signed-off-by: shubham <[email protected]>
goto retry
}
if *newSnap.Status.BoundVolumeSnapshotContentName != snapContent.Name {
return errors.Errorf("volumesnapshot %s is bound to incorrect volumesnapshotcontent: expected %s got %s",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also add ReadyToUse : true check as well ?

// snapclientset.NewForConfig creates a new Clientset for VolumesnapshotV1beta1Client
s.snapClient, err = snapclientset.NewForConfig(cfg)
if err != nil {
klog.Fatalf("Failed to create snapshot client: %v", err)
Copy link

@mittachaitu mittachaitu Jun 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: failed to get snapshot client

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fatal is fine here

return errors.Wrapf(err, "failed to validate new volumesnapshot %s", newSnap.Name)
}
klog.Infof("Cleaing up old volumesnapshot %s", oldSnap.Name)
err = snap.NewKubeClient().WithNamespace(oldSnap.Namespace).Delete(oldSnap.Name, &metav1.DeleteOptions{})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a note saying, users should perform migration only from latest version of OpenEBS.

Copy link

@mittachaitu mittachaitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are good

Copy link

@prateekpandey14 prateekpandey14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@prateekpandey14 prateekpandey14 merged commit 407cabe into openebs-archive:master Jun 12, 2020
@shubham14bajpai shubham14bajpai deleted the snapshot branch August 19, 2020 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants