-
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] allow provider specific infra machine template for upgrade tests #6075
✨ [E2E] allow provider specific infra machine template for upgrade tests #6075
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.
Overall looks good, thx!
A few nits, mostly around naming.
test/e2e/common.go
Outdated
EtcdVersionUpgradeTo = "ETCD_VERSION_UPGRADE_TO" | ||
CoreDNSVersionUpgradeTo = "COREDNS_VERSION_UPGRADE_TO" | ||
IPFamily = "IP_FAMILY" | ||
KubernetesVersionUpgradeMachineTemplateTo = "KUBERNETES_VERSION_UPGRADE_MACHINE_TEMPLATE_TO" |
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.
KubernetesVersionUpgradeMachineTemplateTo = "KUBERNETES_VERSION_UPGRADE_MACHINE_TEMPLATE_TO" | |
MachineTemplateUpgradeTo = "MACHINE_TEMPLATE_UPGRADE_TO" |
nit: I think it reads better in this order / then follows the same pattern as KUBERNETES_VERSION_UPGRADE_TO
Can you also move it directly below KubernetesVersionUpgradeTo
?
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.
Ideally I would prefer a common prefix with the other UPGRADE_TO env var, but given that we can't easily change the existing env var I would prefer the one I proposed. But let's see what @fabriziopandini thinks.
(except if we deprecate the old var and introduce a new one...)
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.
+1 to MACHINE_TEMPLATE_UPGRADE_TO
(we strive for a common suffix)
test/e2e/cluster_upgrade.go
Outdated
EtcdImageTag: input.E2EConfig.GetVariable(EtcdVersionUpgradeTo), | ||
DNSImageTag: input.E2EConfig.GetVariable(CoreDNSVersionUpgradeTo), | ||
KubernetesUpgradeVersion: input.E2EConfig.GetVariable(KubernetesVersionUpgradeTo), | ||
KubernetesVersionUpgradeMachineTemplateTo: k8sVersionUpgradeMachineTemplateTo, |
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.
KubernetesVersionUpgradeMachineTemplateTo: k8sVersionUpgradeMachineTemplateTo, | |
KubernetesUpgradeMachineTemplate: k8sVersionUpgradeMachineTemplateTo, |
test/e2e/cluster_upgrade.go
Outdated
ClusterProxy: input.BootstrapClusterProxy, | ||
Cluster: clusterResources.Cluster, | ||
UpgradeVersion: input.E2EConfig.GetVariable(KubernetesVersionUpgradeTo), | ||
KubernetesVersionUpgradeMachineTemplateTo: k8sVersionUpgradeMachineTemplateTo, |
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.
KubernetesVersionUpgradeMachineTemplateTo: k8sVersionUpgradeMachineTemplateTo, | |
UpgradeMachineTemplate: k8sVersionUpgradeMachineTemplateTo, |
@@ -310,7 +311,9 @@ func UpgradeControlPlaneAndWaitForUpgrade(ctx context.Context, input UpgradeCont | |||
Expect(err).ToNot(HaveOccurred()) | |||
|
|||
input.ControlPlane.Spec.Version = input.KubernetesUpgradeVersion | |||
|
|||
if input.KubernetesVersionUpgradeMachineTemplateTo != nil { | |||
input.ControlPlane.Spec.MachineTemplate.InfrastructureRef.Name = pointer.StringDeref(input.KubernetesVersionUpgradeMachineTemplateTo, "") |
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.
input.ControlPlane.Spec.MachineTemplate.InfrastructureRef.Name = pointer.StringDeref(input.KubernetesVersionUpgradeMachineTemplateTo, "") | |
input.ControlPlane.Spec.MachineTemplate.InfrastructureRef.Name = *input.KubernetesVersionUpgradeMachineTemplateTo |
nit. Should be fine as we already handle the nil one line above
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.
same in UpgradeMachineDeploymentsAndWait
99ee1f8
to
7e2d4f5
Compare
7e2d4f5
to
20a0a9a
Compare
/lgtm |
@aartij17 thanks for improving the test framework! All the providers will benefit from this! |
Thank you very much! Really nice addition, which should enable more providers to be able to use the upgrade e2e test. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
/cc @fabriziopandini WDYT? |
+1 to backport considering it can help providers and the change is small/well confined |
@fabriziopandini: cannot checkout In response to this:
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. |
/cherry-pick release-1.1 |
@fabriziopandini: new pull request created: #6083 In response to this:
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. |
this is really useful, thanks for doing that!! wondering if we should have two variables one for the control-plane and another for the workers |
+1 for me, this is for providers to use! |
i can work on that @sbueringer @fabriziopandini |
What this PR does / why we need it:
This PR introduces an option to change the infra template in the test spec during the cluster upgrade tests.
Please refer to this slack conversation for more context
cc: @sbueringer @srm09