Skip to content

⚠️ E2E test now resolve CNI_RESOURCES without using env variables#3846

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:release-0.3from
fabriziopandini:investigate-3797
Oct 23, 2020
Merged

⚠️ E2E test now resolve CNI_RESOURCES without using env variables#3846
k8s-ci-robot merged 1 commit into
kubernetes-sigs:release-0.3from
fabriziopandini:investigate-3797

Conversation

@fabriziopandini
Copy link
Copy Markdown
Member

@fabriziopandini fabriziopandini commented Oct 22, 2020

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 SetCNIEnvVar should be now replaced by one (or more) calls to createRepositoryInput.RegisterClusterResourceSetConfigMapTransformation

Fixes #3797
/assign @CecileRobertMichon

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 22, 2020
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 22, 2020
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 22, 2020
@fabriziopandini fabriziopandini changed the base branch from master to release-0.3 October 22, 2020 19:09
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 22, 2020
@fabriziopandini fabriziopandini force-pushed the investigate-3797 branch 2 times, most recently from f6bbcb7 to c9132c9 Compare October 22, 2020 19:25
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 22, 2020
@fabriziopandini fabriziopandini changed the title Investigate 3797 E2E test now resolve CNI_RESOURCES without using env variables Oct 22, 2020
@fabriziopandini
Copy link
Copy Markdown
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 22, 2020
@fabriziopandini
Copy link
Copy Markdown
Member Author

/assign @CecileRobertMichon

@CecileRobertMichon
Copy link
Copy Markdown
Contributor

@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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we make this PR has "breaking" since this is now a no-op?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

makes sense, done + updated PR comment

@fabriziopandini fabriziopandini changed the title E2E test now resolve CNI_RESOURCES without using env variables :Warning E2E test now resolve CNI_RESOURCES without using env variables Oct 22, 2020
@CecileRobertMichon CecileRobertMichon changed the title :Warning E2E test now resolve CNI_RESOURCES without using env variables ⚠️ E2E test now resolve CNI_RESOURCES without using env variables Oct 22, 2020
Copy link
Copy Markdown
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

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!

Comment thread test/framework/clusterctl/e2e_config.go Outdated
Comment on lines +42 to +43
CNIPath = "CNI"
CNIResources = "CNI_RESOURCES"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Member Author

@fabriziopandini fabriziopandini Oct 23, 2020

Choose a reason for hiding this comment

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

Good catch, I was not aware of the multiple CNI use case!

@CecileRobertMichon
Copy link
Copy Markdown
Contributor

/hold

based on @sedefsavas's comment above

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 23, 2020
@fabriziopandini
Copy link
Copy Markdown
Member Author

@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

Comment thread test/e2e/e2e_suite_test.go Outdated
cniPAth := config.GetVariable(CNIPath)
Expect(cniPAth).To(BeAnExistingFile(), "The %s variable should resolve to an existing file", CNIPath)

createRepositoryInput.RegisterClusterResourceSetConfigMapTransformation(cniPAth, CNIResources)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just to understand, will createClusterctlLocalRepository be called multiple times for adding different CNIs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@sedefsavas
Copy link
Copy Markdown

This lgtm now.
MachinPool test failed but may be a flake.

/test pull-cluster-api-e2e-full-release-0-3

Comment thread test/e2e/e2e_suite_test.go Outdated
Comment thread test/e2e/e2e_suite_test.go Outdated
Comment thread test/e2e/e2e_suite_test.go Outdated
@CecileRobertMichon
Copy link
Copy Markdown
Contributor

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

@fabriziopandini
Copy link
Copy Markdown
Member Author

kk, I will wait for test results in CAPZ before addressing the nits

@CecileRobertMichon
Copy link
Copy Markdown
Contributor

CAPZ e2e passed 🎉

@fabriziopandini
Copy link
Copy Markdown
Member Author

@CecileRobertMichon thanks for validating this change on CAPZ!
comment addresses and squashed

@CecileRobertMichon
Copy link
Copy Markdown
Contributor

thanks for fixing it :)

/lgtm
/approve
/hold cancel

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 23, 2020
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[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

Details 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 Oct 23, 2020
@CecileRobertMichon
Copy link
Copy Markdown
Contributor

/retest

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

k8s-ci-robot commented Oct 23, 2020

@fabriziopandini: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-e2e-main ed531f4 link /test pull-cluster-api-e2e-main
pull-cluster-api-make-main ed531f4 link /test pull-cluster-api-make-main
pull-cluster-api-build-main ed531f4 link /test pull-cluster-api-build-main
pull-cluster-api-test-main ed531f4 link /test pull-cluster-api-test-main
pull-cluster-api-apidiff-main ed531f4 link /test pull-cluster-api-apidiff-main
pull-cluster-api-apidiff-release-0-3 14dba99 link /test pull-cluster-api-apidiff-release-0-3

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.

Details

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. I understand the commands that are listed here.

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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants