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

🌱 Initial e2e test for Runtime SDK lifecycle hook #6664

Conversation

killianmuldoon
Copy link
Contributor

Signed-off-by: killianmuldoon [email protected]
Co-authored-by: ykakarap [email protected]

This PR extends the Cluster upgrade with Runtime SDK end to end test by adding registrations for lifecycle hooks. The handlers record that they've been called to a configMap and the test checks that each of the hooks has been called at least once during the test flow.

Note, BeforeClusterDelete is currently left out pending #6644 , but is simple to add in once that has merged.
Part of #6546

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 17, 2022
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 17, 2022
@killianmuldoon killianmuldoon force-pushed the runtimeSDK/lifecycle-hooks-e2e branch 2 times, most recently from 22ead4f to 72e3116 Compare June 17, 2022 14:19
test/extension/config/default/extension.yaml Outdated Show resolved Hide resolved
test/extension/config/default/extension_image_patch.yaml Outdated Show resolved Hide resolved
test/extension/config/default/role.yaml Outdated Show resolved Hide resolved
test/extension/main.go Outdated Show resolved Hide resolved
test/extension/handlers/lifecycle/handlers.go Outdated Show resolved Hide resolved
test/extension/handlers/lifecycle/handlers.go Show resolved Hide resolved
test/extension/handlers/lifecycle/handlers.go Outdated Show resolved Hide resolved
test/extension/handlers/lifecycle/handlers.go Outdated Show resolved Hide resolved
test/e2e/cluster_upgrade_runtimesdk.go Outdated Show resolved Hide resolved
test/e2e/cluster_upgrade_runtimesdk.go Outdated Show resolved Hide resolved
@killianmuldoon killianmuldoon force-pushed the runtimeSDK/lifecycle-hooks-e2e branch 3 times, most recently from d076660 to 4cd48ea Compare June 20, 2022 13:48

func checkLifecycleHooks(ctx context.Context, c client.Client, namespace string, clusterName string, hooks map[string]string) error {
configMap := &corev1.ConfigMap{}
configMapName := clusterName + "-hookresponses"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What we're checking here is that each hook has been called at least once.

We're not checking to see if the hooks are blocking or not, but plan to do that in a future iteration.

@killianmuldoon killianmuldoon changed the title [WIP] 🌱 Initial e2e test for Runtime SDK lifecycle hook 🌱 Initial e2e test for Runtime SDK lifecycle hook Jun 20, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 20, 2022
@sbueringer
Copy link
Member

One nit, otherwise lgtm from my side. As commented, we'll extend this test in a follow-up PR to also test the blocking behavior but this PR is already a very good first step

/assign @fabriziopandini

@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 20, 2022
@sbueringer
Copy link
Member

/assign @fabriziopandini

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.

one nit, but optional :-)

/lgtm

test/e2e/cluster_upgrade_runtimesdk.go Outdated Show resolved Hide resolved
Signed-off-by: killianmuldoon <[email protected]>
Co-authored-by: ykakarap <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2022
@sbueringer
Copy link
Member

/lgtm

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

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

/lgtm

test/extension/handlers/lifecycle/handlers.go Show resolved Hide resolved
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

this is neat!
looking forward to seeing this test improved with checks for blocking web hooks!
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 Jun 22, 2022
@fabriziopandini
Copy link
Member

/cherry-pick release-1.2

@k8s-infra-cherrypick-robot

@fabriziopandini: once the present PR merges, I will cherry-pick it on top of release-1.2 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.2

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.

@k8s-infra-cherrypick-robot

@fabriziopandini: new pull request created: #6702

In response to this:

/cherry-pick release-1.2

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.

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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants