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 a pre-delete helm hook to clean up webhook configs #751

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

almaslennikov
Copy link
Contributor

@almaslennikov almaslennikov commented Jul 29, 2024

Mutating and Validating webhook configs are created programmatically and are not managed by helm. To clean them up on helm delete, adding a small pre-delete hook

Copy link

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

almaslennikov added a commit to almaslennikov/network-operator that referenced this pull request Jul 29, 2024
Mutating and Validating webhook configs are created programmatically
and are not managed by helm.
To clean them up on helm delete, adding a small pre-delete hook
k8snetworkplumbingwg/sriov-network-operator#751

Signed-off-by: amaslennikov <[email protected]>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10144409112

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 43.964%

Files with Coverage Reduction New Missed Lines %
controllers/sriovnetworkpoolconfig_controller.go 6 63.7%
Totals Coverage Status
Change from base Build 10072193709: 0.02%
Covered Lines: 6526
Relevant Lines: 14844

💛 - Coveralls

serviceAccountName: {{ include "sriov-network-operator.fullname" . }}
containers:
- name: cleanup
image: bitnami/kubectl:latest
Copy link
Collaborator

Choose a reason for hiding this comment

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

overall LGTM. i wonder if we should go with that or implement small "cleanup" binary which will do these operations using client-go lib. having this binary part of the sriov-network-operator image.

@ykulazhenkov @SchSeba @zeeke @Eoghan1232 thoughts ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

as a quick workaround, I think approach is probably fine.
but if there is a need to clean up additional resources through something like this, then a binary called from client-go lib would be a better approach probably so that way operator has control.....

Copy link
Collaborator

Choose a reason for hiding this comment

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

two points here:

  1. yes we need a binary inside our image. use-case disconnected environments where the user needs to clone images and we have variables in helm to allow him specify the images for the operator. this one is static.
  2. add a step in the run CI for k8s to test this

apiVersion: batch/v1
kind: Job
metadata:
name: "{{ include "sriov-network-operator.fullname" . }}-post-delete-hook"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the name is -post-delete-hook? The hook is pre-delete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants