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

✨ Clusterctl move with clusterclass #5499

Conversation

ykakarap
Copy link
Contributor

What this PR does / why we need it:
This PRs add ClusterClass support to clusterctl move command.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5445

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 26, 2021
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 26, 2021
@ykakarap
Copy link
Contributor Author

/hold
until PR #5486 is merged.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 26, 2021
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

First pass
This is definitely going in the right direction, I have only some nits on tests/builders

cmd/clusterctl/client/cluster/objectgraph_test.go Outdated Show resolved Hide resolved
cmd/clusterctl/internal/test/fake_objects.go Outdated Show resolved Hide resolved
internal/builder/builders.go Outdated Show resolved Hide resolved
@ykakarap ykakarap force-pushed the clusterctl-move-with-clusterclass branch from 0551b6f to 90db0e3 Compare October 27, 2021 21:12
@ykakarap ykakarap changed the title ✨ [WIP] Clusterctl move with clusterclass ✨ Clusterctl move with clusterclass Oct 27, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2021
@ykakarap ykakarap force-pushed the clusterctl-move-with-clusterclass branch from 90db0e3 to b254592 Compare October 31, 2021 03:31
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 31, 2021
@vincepri
Copy link
Member

vincepri commented Nov 2, 2021

Can we unhold?

@ykakarap
Copy link
Contributor Author

ykakarap commented Nov 2, 2021

/hold cancel

Yes, the other PR is merged.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 2, 2021
@fabriziopandini
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2021
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Looks good to me.

A few questions to confirm my understanding of clusterctl move.

clusterctl move currently only moves entire namespaces, correct? So we don't have to care about which Cluster is using which ClusterClass and if the ClusterClass can already be moved, etc. ...

I assume this PR enable clusterctl move, backup and restore with ClusterClass?

I wonder if we should have an e2e test for clusterctl move at some point (not in this PR). Out of curiosity, did you test it manually to make sure it works and we're not missing anything?

cmd/clusterctl/internal/test/fake_objects.go Show resolved Hide resolved
@ykakarap ykakarap force-pushed the clusterctl-move-with-clusterclass branch from b254592 to ea33388 Compare November 3, 2021 23:19
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 3, 2021
@ykakarap ykakarap force-pushed the clusterctl-move-with-clusterclass branch from ea33388 to fc2bbbb Compare November 3, 2021 23:38
@ykakarap
Copy link
Contributor Author

ykakarap commented Nov 3, 2021

clusterctl move currently only moves entire namespaces, correct? So we don't have to care about which Cluster is using which ClusterClass and if the ClusterClass can already be moved, etc. ...

Yes, clsuterctl move operated on one namespace. Since ClusterClasses are also namespaced and a cluster can only use a clusterclass in the same namespace we can be sure that if a cluster is moving then the associated ClusterClass is also moving. To add to that ClusterClass is treated as a root of the graph. So ClusterClass along with all the associated templates (nodes in the clusterclass graph) will move along with it.

I assume this PR enable clusterctl move, backup and restore with ClusterClass?

Yes. Backup and restore also uses the same underlying tooling as move. So once this PR will also support backup and restore.

I wonder if we should have an e2e test for clusterctl move at some point (not in this PR). Out of curiosity, did you test it manually to make sure it works and we're not missing anything?

Yes, I am already working on adding e2e tests for clusterctl move. I tested this a few times manually. After solving this I did not hit any other issues.

@sbueringer
Copy link
Member

sbueringer commented Nov 4, 2021

Great, thx!
/lgtm
(not sure if you want to do the webhook change in this PR or a follow-up, maybe better to do it separately)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 4, 2021
@fabriziopandini
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2021
@k8s-ci-robot k8s-ci-robot merged commit de11b77 into kubernetes-sigs:main Nov 4, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.1 milestone Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance clusterctl move to work with clusterclass and managed topologies
6 participants