-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨clusterctl: move shared objects #2161
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 shared objects #2161
Conversation
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.
First pass, thanks for working on this!
} | ||
|
||
// Define the move sequence by processing the ownerReference chain, so we ensure that a node is moved only after its owners. | ||
// Additionally nodes are grouped, so bulk of nodes can be moved in parallel. e.g. |
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.
Should we s/node/resource/ here? I can extrapolate that it's meant to mean a node in the graph, but it could likely cause someone not familiar with cluster api to think it means a k8s Node resource here.
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.
I will make a pass to make it clear in the comment where we are talking about nodes in the graphs, but I would like to keep the names as it is.
/retest |
@fabriziopandini Go for it, we don't need it to be parallel now |
@vincepri done |
Seems linter is unhappy
|
c2d2ff1
to
22be9f9
Compare
@vincepri CI is happy again 😉 |
/test pull-cluster-api-e2e |
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.
/approve
/assign @ncdc
for final lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini, vincepri 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 |
}, | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
graph, err := getDetachedObjectGraphWihObjs(tt.fields.objs) | ||
gb, err := getDetachedObjectGraphWihObjs(tt.fields.objs) |
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.
Why this change?
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.
I'm getting a little bit obsessed by code readability 🤣
If you prefer I can rollback
@ncdc comment addressed |
LGTM. @fabriziopandini please squash! |
3be299c
to
ca66c55
Compare
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
What this PR does / why we need it:
This PR refactors clusterctl in order to support move when two or move clusters are sharing some objects (like e.g. Templates or LoadBalancers).
The PR takes a generic approach to solve this problem and the move sequence is defined by processing the ownerReference chain, so we ensure that a node is moved only after its owners.
Additionally, nodes are grouped, so each group of nodes can be moved in parallel. e.g.
Which issue(s) this PR fixes:
rif: #1729
/area clusterctl
/assign @ncdc
/assign @vincepri