-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
✨ Adds kubeadm control plane scale up/down #2335
✨ Adds kubeadm control plane scale up/down #2335
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.
The changes to go.mod and go.sum should be reverted. We want client-go 0.17.2 and the framework should not be importing CAPD
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller_test.go
Outdated
Show resolved
Hide resolved
controlplane/kubeadm/controllers/kubeadm_control_plane_controller_test.go
Outdated
Show resolved
Hide resolved
|
||
for i := 0; i < 3; i++ { | ||
m, _ := createMachineNodePair(fmt.Sprintf("test-%d", i), cluster, kcp, true) | ||
g.Expect(fakeClient.Create(context.Background(), m)).To(Succeed()) |
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.
It might be a bit cleaner if we create these resources prior to creating the fake client and feed them into the function for creating the fake client.
controlplane/kubeadm/controllers/kubeadm_control_plane_controller_test.go
Outdated
Show resolved
Hide resolved
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.
The only other change I had to make was in the test, increasing a timeout:
- framework.WaitForKubeadmControlPlaneMachinesToExist(ctx, assertKubeadmControlPlaneNodesExistInput)
+ framework.WaitForKubeadmControlPlaneMachinesToExist(ctx, assertKubeadmControlPlaneNodesExistInput, "5m", "10s")
capd-e2es passed!
controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go
Outdated
Show resolved
Hide resolved
I'll revert that. What do I do about it locally, though? That's the diff after running
|
Ping when you're ready for another set of 👀 |
That's very weird. On my system, that is not the case. Once I revert those changes and run make modules, go.sum cleans up and my changes persist 🤔 Let's see if prow complains after you revert them. It will complain about outdated files if go modules is not up to date. |
25381d1
to
57a9876
Compare
2750001
to
c7648e1
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chuckha, dlipovetsky 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 |
e8fd512
to
6c6af06
Compare
Reviewing |
func (o MachinesByCreationTimestamp) Less(i, j int) bool { | ||
if o[i].CreationTimestamp.Equal(&o[j].CreationTimestamp) { | ||
return o[i].Name < o[j].Name | ||
} |
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'd use sort.Slice
instead of creating yet a new type here
Signed-off-by: Daniel Lipovetsky <dlipovetsky@d2iq.com>
6c6af06
to
386d3bf
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:
Kubeadm control plane scale up and down, as described in #2241
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 #2241, #2016
I'm replacing the scale up unit tests because with the health checks introduced for scale up, they would become integration tests. For the new scale up/down unit tests, I'm going to fake the management cluster.
I'm also replacing the delete unit tests, because the existing ones rely on scaling up the cluster. I'll replace them with a test that works against a static set of machines.
/assign @chuckha @detiber @randomvariable