-
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
🏃[e2e] Add machine deployment scaling helper function #3027
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.
/approve
/assign @fabriziopandini
/milestone v0.3.6
/assign @gab-satchi |
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.
@sedefsavas
two tiny nits, then ready to go for me
@sedefsavas unrelated. There is s a bounce of upgrade failures that I can't nail down to a problem. Almost all of them happen in the cluster provisioning phase |
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.
Thanks for the changes :)
machineSet := ms.Items[0] | ||
selectorMap, err = metav1.LabelSelectorAsMap(&machineSet.Spec.Selector) | ||
if err != nil { | ||
return 0, err |
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.
Can the error states return -1 similar to what's done below on line 344. -1 is just more indicative of an error. Also, is there a reason for the function to even return the errors?
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.
Right, changed to -1. Since the error reason is not only the number mismatch, for better visibility in the logs, returning error here.
Expect(input.ClusterProxy).ToNot(BeNil(), "Invalid argument. input.ClusterProxy can't be nil when calling ScaleAndWaitMachineDeployment") | ||
Expect(input.Cluster).ToNot(BeNil(), "Invalid argument. input.Cluster can't be nil when calling ScaleAndWaitMachineDeployment") | ||
|
||
fmt.Fprintf(GinkgoWriter, "Scaling machine deployment %s/%s from %v to %v replicas\n", input.MachineDeployment.Namespace, input.MachineDeployment.Name, input.MachineDeployment.Spec.Replicas, input.Replicas) |
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.
Using Ginkgo's By
might be cleaner 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.
In all new helpers, we log like this. If you think By
should be used in all helpers, we should track it in a separate issue.
@fabriziopandini I think 3-node upgrade hits timeout but I see you already increased the timeout, I will observe if it fixes. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini, sedefsavas, 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 |
/lgtm |
What this PR does / why we need it:
This PR adds scale helper for machine deployment.
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 #3015