Skip to content
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

🌱 Add PostCreateNamespace hook to E2E tests #10067

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR adds a new PostNamespaceCreated to all E2E tests input objects, thus allowing to inject a function to be run after the test namespace is created. If not specified, this is a no-op.

This can be useful to apply environment settings that apply at the namespace level, eg. setting ResourceQuotas

/area E2E-testing

@k8s-ci-robot k8s-ci-robot added area/e2e-testing Issues or PRs related to e2e testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 29, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 29, 2024
@@ -168,6 +172,11 @@ func scaleSpec(ctx context.Context, inputGetter func() scaleSpecInput) {
LogFolder: filepath.Join(input.ArtifactFolder, "clusters", input.BootstrapClusterProxy.GetName()),
IgnoreAlreadyExists: true,
})

if input.PostNamespaceCreated != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: this is the only test that is not using setupSpecNamespace (the reason is explained above; we are pinning namespace name vs creating a name with a random suffix).

@fabriziopandini
Copy link
Member Author

NOTE: given that the change is clean, non-breaking, and scoped to the test framework only, it would be nice to backport to the 1.6 branch

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 29, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: be5f65de2fb9fd5254424aebc596245a07982a22

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 29, 2024
@fabriziopandini fabriziopandini force-pushed the add-postCreateNamespace-hook-to-E2E-tests branch from a9c9e8c to 626a37b Compare January 30, 2024 14:07
@fabriziopandini
Copy link
Member Author

@sbueringer this one should be ready to go now

@sbueringer sbueringer added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jan 30, 2024
@sbueringer
Copy link
Member

Thx!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 6dca4494913bbde619cd51c56e1d366e770593aa

@k8s-ci-robot
Copy link
Contributor

[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 /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 Jan 30, 2024
@k8s-ci-robot k8s-ci-robot merged commit 829362d into kubernetes-sigs:main Jan 30, 2024
21 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Jan 30, 2024
@fabriziopandini fabriziopandini deleted the add-postCreateNamespace-hook-to-E2E-tests branch February 24, 2024 13:31
Dhairya-Arora01 pushed a commit to Dhairya-Arora01/cluster-api that referenced this pull request May 25, 2024
* Add PostCreateNamespace hook to E2E tests

* Fix for test who are creating an additional management cluster
Dhairya-Arora01 pushed a commit to Dhairya-Arora01/cluster-api that referenced this pull request May 25, 2024
* Add PostCreateNamespace hook to E2E tests

* Fix for test who are creating an additional management cluster
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. area/e2e-testing Issues or PRs related to e2e testing 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants