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

🌱 Support MachinePools without MachinePoolMachines in clusterctl upgrade test #10498

Merged
merged 1 commit into from
May 7, 2024

Conversation

willie-yao
Copy link
Contributor

What this PR does / why we need it:
This PR adds support for MachinePools without MachinePoolMachines in the clusterctl upgrade test. It does so by waiting for the correct number of ready replicas rather than counting Machines by listing them from the management cluster.

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 #10134

/area testing

@k8s-ci-robot k8s-ci-robot added area/testing Issues or PRs related to testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 23, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 23, 2024
@willie-yao
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@k8s-ci-robot
Copy link
Contributor

@willie-yao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-blocking-main
  • /test pull-cluster-api-e2e-conformance-ci-latest-main
  • /test pull-cluster-api-e2e-conformance-main
  • /test pull-cluster-api-e2e-dualstack-and-ipv6-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-e2e-mink8s-main
  • /test pull-cluster-api-e2e-upgrade-1-30-1-31-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-blocking-main
  • pull-cluster-api-test-main
  • pull-cluster-api-verify-main

In response to this:

/test pull-cluster-api-e2e-full-main

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@willie-yao
Copy link
Contributor Author

/test pull-cluster-api-e2e-main

@@ -127,6 +128,8 @@ type ClusterctlUpgradeSpecInput struct {
// If not set, the test will upgrade once to the v1beta1 contract.
// For some examples see clusterctl_upgrade_test.go
Upgrades []ClusterctlUpgradeSpecInputUpgrade

SkipMachinePoolMachines bool
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a godoc comment that this is used for providers which don't support machine pool machines (don't remember the exact wording)

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way this could be detected automatically? Maybe with the MachinePool's status. infrastructureMachineKind like the MachinePool controller does?

if err := util.UnstructuredUnmarshalField(infraMachinePool, &infraMachineKind, "status", "infrastructureMachineKind"); err != nil {
if errors.Is(err, util.ErrUnstructuredFieldNotFound) {
log.V(4).Info("MachinePool Machines not supported, no infraMachineKind found")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup this makes sense. Made this change in 7960aff

test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 24, 2024
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
Comment on lines 453 to 455
expectedMachineCount := *controlPlaneMachineCount
if !skipMachinePoolMachines {
expectedMachineCount += expectedWorkerCount
Copy link
Member

Choose a reason for hiding this comment

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

Don't we have to diferentiate between machinepool workers and machinedeployment workers here?

Isn't this something like:

Suggested change
expectedMachineCount := *controlPlaneMachineCount
if !skipMachinePoolMachines {
expectedMachineCount += expectedWorkerCount
expectedMachineCount := *controlPlaneMachineCount + expectedMachineDeploymentWorkerCount
if !skipMachinePoolMachines {
expectedMachineCount += expectedMachinePoolWorkerCount

@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main

(I"ll take a look once tests are green and Christian is happy :))

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtmz

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9a6610523c71a46a04fbceb0e707095a8d0f187f

test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2024
@willie-yao
Copy link
Contributor Author

/test pull-cluster-api-e2e-main

@willie-yao
Copy link
Contributor Author

/retest

test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
test/e2e/clusterctl_upgrade.go Outdated Show resolved Hide resolved
@willie-yao willie-yao force-pushed the mp-upgrade branch 2 times, most recently from 3d05916 to cdbe9df Compare May 3, 2024 17:09
@willie-yao
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@k8s-ci-robot
Copy link
Contributor

@willie-yao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-blocking-main
  • /test pull-cluster-api-e2e-conformance-ci-latest-main
  • /test pull-cluster-api-e2e-conformance-main
  • /test pull-cluster-api-e2e-dualstack-and-ipv6-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-e2e-mink8s-main
  • /test pull-cluster-api-e2e-upgrade-1-30-1-31-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-blocking-main
  • pull-cluster-api-test-main
  • pull-cluster-api-verify-main

In response to this:

/test pull-cluster-api-e2e-full-main

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@willie-yao
Copy link
Contributor Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member

Thx, last nit from my side

/assign @chrischdi

@sbueringer
Copy link
Member

Thx!

/lgtm

/assign @chrischdi

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 7, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e263e680085cf64fc696b325bf90d12c9f0c6bf2

@chrischdi
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi

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 7, 2024
@k8s-ci-robot k8s-ci-robot merged commit 6ac7085 into kubernetes-sigs:main May 7, 2024
19 of 20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.8 milestone May 7, 2024
@willie-yao
Copy link
Contributor Author

Had to create another fix in #10584 due to an issue with the controlplane machine count previously being hard-coded to 1.

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. area/testing Issues or PRs related to testing 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.

Allow MachinePools without MachinePoolMachines to exist in workload cluster for clusterctl upgrade e2e test
5 participants