⚠️ E2E test now resolve CNI_RESOURCES without using env variables#3846
Conversation
54376e9 to
76b678a
Compare
76b678a to
ed531f4
Compare
f6bbcb7 to
c9132c9
Compare
|
/hold cancel |
|
/assign @CecileRobertMichon |
|
@fabriziopandini were you able to test this with the longer calico manifest? |
| // Deprecated: CNI manifest will be now automatically embedded into cluster templates during create repository. | ||
| // The new approach does not uses env variables so we can avoid https://github.com/kubernetes-sigs/cluster-api/issues/3797; | ||
| // This func is preserved for avoiding to break users in the v0.3 series, but it is now a noop. | ||
| func SetCNIEnvVar(cniManifestPath string, cniEnvVar string) { |
There was a problem hiding this comment.
should we make this PR has "breaking" since this is now a no-op?
There was a problem hiding this comment.
makes sense, done + updated PR comment
CecileRobertMichon
left a comment
There was a problem hiding this comment.
lgtm
This doesn't look to be breaking for other providers using CNI with CRS but assigning a few others to confirm 👀
/assign @sedefsavas @richardcase @cpanato
thanks for figuring out the root cause @fabriziopandini!
| CNIPath = "CNI" | ||
| CNIResources = "CNI_RESOURCES" |
There was a problem hiding this comment.
If we define these here, I think we will limit the CNIs to only 1 per e2e tests.
Previously, to use a different CNI, these parameters were being changed and by setting the changed parameters to CRS as data was working fine.
CAPZ is using multiple CNIs. cc @CecileRobertMichon
There was a problem hiding this comment.
Ooh great catch @sedefsavas. That's true, we do that for IPv6 https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/master/test/e2e/e2e_suite_test.go#L171 (and actually have a different CNIPath defined for that and rely on the SetCNIEnvVar function).
There was a problem hiding this comment.
Good catch, I was not aware of the multiple CNI use case!
|
/hold based on @sedefsavas's comment above |
|
@CecileRobertMichon @sedefsavas I have proposed a solution that allows managing multiple CNI without requiring env variables. /test pull-cluster-api-e2e-full-release-0-3 |
| cniPAth := config.GetVariable(CNIPath) | ||
| Expect(cniPAth).To(BeAnExistingFile(), "The %s variable should resolve to an existing file", CNIPath) | ||
|
|
||
| createRepositoryInput.RegisterClusterResourceSetConfigMapTransformation(cniPAth, CNIResources) |
There was a problem hiding this comment.
Just to understand, will createClusterctlLocalRepository be called multiple times for adding different CNIs?
There was a problem hiding this comment.
No, there will be only one call to createClusterctlLocalRepository as of today.
However, inside this func you have to register one ClusterResourceSetConfigMapTransformation for each CNI you want to support.
|
This lgtm now. /test pull-cluster-api-e2e-full-release-0-3 |
|
I updated my Calico PR to use your branch and applied the changes to verify everything works as expected with two CNIs https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/991/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R37 |
|
kk, I will wait for test results in CAPZ before addressing the nits |
|
CAPZ e2e passed 🎉 |
cb51836 to
14dba99
Compare
|
@CecileRobertMichon thanks for validating this change on CAPZ! |
|
thanks for fixing it :) /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@fabriziopandini: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
This PR makes the E2E framework to resolve CNI_RESOURCES without using env variables, thus avoiding problems when the CNI manifest is too long.
As a consequence of this change the call to
SetCNIEnvVarshould be now replaced by one (or more) calls tocreateRepositoryInput.RegisterClusterResourceSetConfigMapTransformationFixes #3797
/assign @CecileRobertMichon
/hold