-
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 framework] Allow cluster upgrade spec to work without MachinePools #5092
✨ [e2e framework] Allow cluster upgrade spec to work without MachinePools #5092
Conversation
var clusterTemplateWorkerMachineCount int64 = 2 | ||
var workerMachineCount = 2 * clusterTemplateWorkerMachineCount |
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 was working on updating cluster-api-provider-packet to v1alpha4 and adopting the upstream test specs. The only thing preventing me from using ClusterUpgradeConformanceSpec is that it expects that a provider implements MachinePools, since we do not the spec always fails because the machine count does not match.
test/e2e/cluster_upgrade.go
Outdated
// also adjust the expected workerMachineCount if we have MachinePools | ||
var workerMachineCount = clusterTemplateWorkerMachineCount | ||
if len(clusterResources.MachinePools) > 0 { | ||
workerMachineCount = 2 * workerMachineCount |
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.
workerMachineCount = 2 * workerMachineCount | |
workerMachineCount += int64(len(clusterResources.MachinePools)) * workerMachineCount |
This way it would also work with >1 MachinePools, what do you think?
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.
Added a couple of helper methods to the ApplyClusterTemplateAndWaitResult type to support both multiple MachinePools and multiple MachineDeployments. I expected there to be additional uses of this in other tests, but it looks like this was the only test that did this type of computation, so the updated refactor might be a bit overkill 😂
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
pending @sbueringer comment
da01689
to
7331b2f
Compare
/lgtm |
Very nice, thank you :) /lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
What this PR does / why we need it:
Enables providers to use ClusterUpgradeConformanceSpec even if they do not implement MachinePools.