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

🏃[e2e] Add machine deployment scaling helper function #3027

Merged
merged 1 commit into from
May 11, 2020

Conversation

sedefsavas
Copy link

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 7, 2020
@k8s-ci-robot k8s-ci-robot requested review from benmoss and JoelSpeed May 7, 2020 16:55
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 7, 2020
Copy link
Member

@vincepri vincepri left a 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

@k8s-ci-robot k8s-ci-robot added this to the v0.3.6 milestone May 7, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2020
@vincepri
Copy link
Member

vincepri commented May 7, 2020

/assign @gab-satchi

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.

@sedefsavas
two tiny nits, then ready to go for me

test/framework/machinedeployment_helpers.go Outdated Show resolved Hide resolved
test/framework/machinedeployment_helpers.go Outdated Show resolved Hide resolved
@fabriziopandini
Copy link
Member

@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

Copy link
Member

@gab-satchi gab-satchi left a 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
Copy link
Member

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?

Copy link
Author

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)
Copy link
Member

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.

Copy link
Author

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.

@sedefsavas
Copy link
Author

@fabriziopandini I think 3-node upgrade hits timeout but I see you already increased the timeout, I will observe if it fixes.

@fabriziopandini
Copy link
Member

/approve
Leaving final lgtm to @gab-satchi

@k8s-ci-robot
Copy link
Contributor

[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:
  • OWNERS [fabriziopandini,vincepri]

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

@gab-satchi
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 May 11, 2020
@k8s-ci-robot k8s-ci-robot merged commit 761b980 into kubernetes-sigs:master May 11, 2020
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e Framework: machine deployment helper to scale a machine deployment
5 participants