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

Adding webhook 'delete' command to remove non-namespaced objects #791

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

heyvister1
Copy link

@heyvister1 heyvister1 commented Oct 14, 2024

sriov-network-operator dynamically creates validating/mutating/clusterroles/clusterrolebinding cluster objects, for specified SriovOperatorConfig. These objects are not being cleaned once sriov operator is uninstalled (via Helm/Openshift).

The proposed PR is to use a small go binary within Helm pre-delete hook. This binary will delete default SriovOperatorConfig, assuming added SriovOperatorConfig finalizer will make sure sriov controller is deleting all generated cluster level objects (e.g. webhooks), prior to operator deployment object is removed by Helm

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.

@coveralls
Copy link

coveralls commented Oct 15, 2024

Pull Request Test Coverage Report for Build 11459784654

Details

  • 80 of 116 (68.97%) changed or added relevant lines in 3 files are covered.
  • 7 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.5%) to 45.467%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/sriov-network-operator-config-cleanup/cleanup.go 34 44 77.27%
cmd/sriov-network-operator-config-cleanup/main.go 0 10 0.0%
controllers/sriovoperatorconfig_controller.go 46 62 74.19%
Files with Coverage Reduction New Missed Lines %
controllers/drain_controller.go 1 68.06%
controllers/sriovoperatorconfig_controller.go 1 71.39%
controllers/generic_network_controller.go 5 74.38%
Totals Coverage Status
Change from base Build 11441395281: 0.5%
Covered Lines: 6765
Relevant Lines: 14879

💛 - Coveralls

@heyvister1 heyvister1 force-pushed the webhooks-k8s-objects-deletion branch 3 times, most recently from 52d9671 to 693e48d Compare October 20, 2024 15:21
@heyvister1
Copy link
Author

/test-all

generated cluster wise objects (e.g
Mutating/Validating/ClusterRoles/ClusterRoleBinding).

webhook delete command can be used with Helm unintall  pre-delete hook, to cleanup
remaining non-namespaced objects

Signed-off-by: Ido Heyvi <iheyvi@nvidia.com>
Signed-off-by: Ido Heyvi <iheyvi@nvidia.com>
Signed-off-by: Ido Heyvi <iheyvi@nvidia.com>
webhooks objects removal by sriov operator

Signed-off-by: Ido Heyvi <iheyvi@nvidia.com>
@heyvister1 heyvister1 force-pushed the webhooks-k8s-objects-deletion branch 2 times, most recently from 13b3cda to e2440c4 Compare October 22, 2024 07:40
@heyvister1 heyvister1 force-pushed the webhooks-k8s-objects-deletion branch 2 times, most recently from 2ee6dad to 56a8346 Compare October 22, 2024 12:06
@heyvister1 heyvister1 requested a review from zeeke October 22, 2024 12:06
@adrianchiris
Copy link
Collaborator

/test-all

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.

5 participants