-
Notifications
You must be signed in to change notification settings - Fork 19
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(migrate): add support to rename spc while migrating to cspc #13
feat(migrate): add support to rename spc while migrating to cspc #13
Conversation
Signed-off-by: shubham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes are good
Signed-off-by: shubham <[email protected]>
Signed-off-by: shubham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provided comments please take a look
if k8serrors.IsNotFound(err) { | ||
return nil | ||
} | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I have another concern with configuration if the user does in below manner:
- The user has multiple SPCs in his setup and launched a job(By applying job YAML by setting
cspc-name
argument) to migrate to CSPC(Consider pool is successfully migrated). - He reused the same Job YAML to migrate another SPC but now somehow he didn't change the
cspc-name
with this steps things will wrong(I can see job will update the blockdeviceclaim labels withcspc-name
argument and return error).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can overcome this by adding old spc name on the cspc and verify that it isn't from another migrated spc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, this problem exists but now it will patch SPC and fail(Can we prevent updating SPC annotation itself?) @shubham14bajpai
Signed-off-by: shubham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provided few comments PTAL
if k8serrors.IsNotFound(err) { | ||
return nil | ||
} | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, this problem exists but now it will patch SPC and fail(Can we prevent updating SPC annotation itself?) @shubham14bajpai
Signed-off-by: shubham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes are good
cspcObj.Annotations = map[string]string{ | ||
// This annotation will be used to disable reconciliation on the dependants. | ||
// In this case that will be CSPI | ||
types.OpenEBSDisableDependantsReconcileKey: "true", | ||
"openebs.io/migrated-from": spcName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Instead of passing spcName as an argument we can make use of c.SPCObj.Name
Signed-off-by: shubham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Signed-off-by: shubham [email protected]
This PR adds the flag
cspc-name
to rename the spc while migrating it to cspc. It also adds checks to prevent deletion of a spc if already a cspc exists with the same name as spc.This PR fixes this Issue: openebs/openebs#3074
Sample job yaml: