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

🌱 Refactor MachineSet scaling code and add more tests #4506

Merged

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Apr 21, 2021

What this PR does / why we need it:
This drops the presumably unncessary split between scaleMachineSet and scaleMachineSetOperation and cover scaleMachineSet with unit tests.

Follow up for #4495, #4505, #4498. Related to #4457

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 #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 21, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 21, 2021
@enxebre
Copy link
Member Author

enxebre commented Apr 21, 2021

Needs #4505
/hold

@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 Apr 21, 2021
@enxebre enxebre changed the title Refactor scale machine set 🌱 Refactor scale machine set Apr 21, 2021
@enxebre
Copy link
Member Author

enxebre commented Apr 21, 2021

When following the Cluster API quick-start [PR-Blocking]
/home/prow/go/src/sigs.k8s.io/cluster-api/test/e2e/quick_start_test.go:27
  Should create a workload cluster [It]
  /home/prow/go/src/sigs.k8s.io/cluster-api/test/e2e/quick_start.go:72
  Timed out after 300.001s.
  Expected
      <int>: 0
  to equal
      <int>: 1

known flake?

/test pull-cluster-api-e2e-main

@enxebre enxebre force-pushed the refactor-scaleMachineSet branch 2 times, most recently from ca7516a to 69c00b8 Compare April 21, 2021 15:48
controllers/machinedeployment_sync.go Outdated Show resolved Hide resolved
controllers/machinedeployment_sync.go Outdated Show resolved Hide resolved
controllers/machinedeployment_sync.go Outdated Show resolved Hide resolved
controllers/machinedeployment_sync.go Outdated Show resolved Hide resolved
controllers/machinedeployment_sync.go Outdated Show resolved Hide resolved
controllers/machinedeployment_sync.go Show resolved Hide resolved
controllers/machinedeployment_sync.go Outdated Show resolved Hide resolved
controllers/machinedeployment_sync_test.go Outdated Show resolved Hide resolved
@enxebre enxebre force-pushed the refactor-scaleMachineSet branch from 69c00b8 to 001a831 Compare April 21, 2021 16:05
@enxebre
Copy link
Member Author

enxebre commented Apr 21, 2021

/hold cancel

@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 Apr 21, 2021
@enxebre enxebre force-pushed the refactor-scaleMachineSet branch from 001a831 to 6a7b5ae Compare April 21, 2021 16:13
@sbueringer
Copy link
Member

@enxebre Yes, with that amount of "not running" errors here: https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/4506/pull-cluster-api-e2e-main/1384873883936493568/artifacts/clusters/bootstrap/controllers/capd-controller-manager/capd-controller-manager-845bbfdf7d-95lpq/manager.log

It's highly likely it was #4405. Especially as (apart from this known issue) this test is if i would have to estimate 98%+ stable.

@sbueringer
Copy link
Member

changes look good to me, but I don't think I'm familiar enough with this code to lgtm

This drops the presumably unncessary split between scaleMachineSet and scaleMachineSetOperation and cover scaleMachineSet with unit tests.
@enxebre enxebre force-pushed the refactor-scaleMachineSet branch from 6a7b5ae to a4ac38b Compare April 22, 2021 16:20
@enxebre
Copy link
Member Author

enxebre commented Apr 22, 2021

sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers: TestReconcileUnhealthyMachines/Remediation_does_not_happen_if_there_is_at_least_one_additional_unhealthy_etcd_member_on_a_3_machine_CP expand_more0s | sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers: TestReconcileUnhealthyMachines/Remediation_does_not_happen_if_there_is_at_least_one_additional_unhealthy_etcd_member_on_a_3_machine_CP expand_more | 0s
-- | -- | --
sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers: TestReconcileUnhealthyMachines/Remediation_does_not_happen_if_there_is_at_least_one_additional_unhealthy_etcd_member_on_a_3_machine_CP expand_more | 0s
sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers: TestReconcileUnhealthyMachines expand_more | sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers: TestReconcileUnhealthyMachines expand_more
sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers: TestReconcileUnhealthyMachines expand_more

/test pull-cluster-api-test-main

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm

@vincepri @sbueringer did you have outstanding comments?

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

@CecileRobertMichon changes are fine for me. just not really familiar with the code

@enxebre
Copy link
Member Author

enxebre commented May 10, 2021

@CecileRobertMichon @vincepri any objection to proceed with this?

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.

/lgtm
/retitle 🌱 Refactor MachineSet scaling code and add more tests

@k8s-ci-robot k8s-ci-robot changed the title 🌱 Refactor scale machine set 🌱 Refactor MachineSet scaling code and add more tests May 10, 2021
@vincepri
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 /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 May 10, 2021
@k8s-ci-robot k8s-ci-robot merged commit ce15591 into kubernetes-sigs:master May 10, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone May 10, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants