-
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
✨ Use different k8s version with each ClusterctlUpgrade test #6388
Conversation
Hi @SubhasmitaSw. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Thanks for this @SubhasmitaSw! I didn't get a chance to run this locally yet - have you managed to get it working?
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.
/ok-to-test
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 lgtm, just a couple of nits
test/e2e/clusterctl_upgrade.go
Outdated
@@ -63,6 +63,7 @@ type ClusterctlUpgradeSpecInput struct { | |||
InitWithBinary string | |||
// InitWithProvidersContract can be used to override the INIT_WITH_PROVIDERS_CONTRACT e2e config variable with a specific | |||
// provider contract to use to initialise the secondary management cluster, e.g. `v1alpha3` | |||
InitWithKubernetesVersion string |
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.
It seems that the comment above the field does not match the field. Also being this a new public field I think we should add a comment for it
test/e2e/clusterctl_upgrade.go
Outdated
clusterctlBinaryURLReplacer := strings.NewReplacer("{OS}", runtime.GOOS, "{ARCH}", runtime.GOARCH) | ||
clusterctlBinaryURL = clusterctlBinaryURLReplacer.Replace(clusterctlBinaryURLTemplate) | ||
Expect(input.E2EConfig.Variables).To(HaveKey(initWithKubernetesVersion)) | ||
Expect(input.E2EConfig.Variables).To(HaveKey(KubernetesVersion)) |
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.
Q: Why are we dropping the check on KubernetesVersion?
// create InitWithKubernetesVersion field to set the init kubernetes version via struct | ||
if input.InitWithKubernetesVersion == "" { | ||
Expect(input.E2EConfig.Variables).To(HaveKey(initWithKubernetesVersion), "Invalid argument. %s variable must be defined when calling %s spec", initWithKubernetesVersion, specName) | ||
Expect(input.E2EConfig.Variables[initWithKubernetesVersion]).ToNot(BeEmpty(), "Invalid argument. %s variable can't be empty when calling %s spec", initWithKubernetesVersion, specName) |
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.
Wondering if we should move this check after the if so we can validate input.InitWithKubernetesVersion
no matter if it comes from a env variable or not
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'm a little confused here, move 'after if', is it the initWithBinary
?
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 think the idea is to move l.142 to after the if/else so we just validate what input. InitWithKubernetesVersion and the validation also is applied to the result we set in the else branch
/test pull-cluster-api-e2e-full-main |
7549563
to
6742363
Compare
@@ -133,6 +135,15 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg | |||
} else { | |||
clusterctlBinaryURLTemplate = input.InitWithBinary | |||
} | |||
|
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.
Can we please move the entire new code block to before l.149 so it's not in the middle of the clusterctlBinaryURL calculation
input.InitWithKubernetesVersion = input.E2EConfig.GetVariable(initWithKubernetesVersion) | ||
} else { | ||
input.InitWithKubernetesVersion = os.Getenv(initWithKubernetesVersion) | ||
} | ||
clusterctlBinaryURLReplacer := strings.NewReplacer("{OS}", runtime.GOOS, "{ARCH}", runtime.GOARCH) | ||
clusterctlBinaryURL = clusterctlBinaryURLReplacer.Replace(clusterctlBinaryURLTemplate) | ||
Expect(input.E2EConfig.Variables).To(HaveKey(initWithKubernetesVersion)) |
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.
Expect(input.E2EConfig.Variables).To(HaveKey(initWithKubernetesVersion)) |
We have to drop this line here as it would fail if the init Kubernetes Version is not set via variables
Expect(input.E2EConfig.Variables[initWithKubernetesVersion]).ToNot(BeEmpty(), "Invalid argument. %s variable can't be empty when calling %s spec", initWithKubernetesVersion, specName) | ||
input.InitWithKubernetesVersion = input.E2EConfig.GetVariable(initWithKubernetesVersion) | ||
} else { | ||
input.InitWithKubernetesVersion = os.Getenv(initWithKubernetesVersion) |
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 don't think we need the else branch. input.E2EConfig.GetVariable does this internally
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 the logic should be
- if input.InitWithKubernetesVersion is set, don't modify it
- if input.InitWithKubernetesVersion is not set get it from variables (which looks for env variables and entries in the e2e config)
@SubhasmitaSw Do you have time to address the findings? |
@sbueringer I'll make this up, thanks for reminding it slipped out of my mind. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I'll implement it as part of #7244 as I need it there /close |
@sbueringer: Closed this PR. 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. |
Fixes #5704