Skip to content

Automate Uncommenting Webhook Blocks in kustomize.yaml When Scaffolding Webhooks #4422

Open
@camilamacedo86

Description

What do you want to happen?

Currently, when scaffolding webhooks (default or conversion or validation), users need to manually uncomment the relevant blocks in the config/default/kustomization.yaml file. This process can be automated to improve the user experience.

Problem

  • When scaffolding default webhooks, users must manually uncomment the corresponding sections in the kustomization.yaml file.
  • For conversion webhooks, the injected code requires further manual adjustments to uncomment specific blocks.
  • In the e2e tests, the uncommenting is handled via shell scripts (example here), which could be avoided if the tool itself handles this step during scaffolding.

Solution

  1. Automate Uncommenting:

  2. Raise Warnings:

    • If the tool cannot automatically uncomment the code (e.g., file issues or other constraints), it should raise a warning instead of throwing an error. This ensures the user knows what to fix manually without blocking the workflow.
  3. Remove Shell Script Dependencies in CI:

    • Remove references in GitHub Actions that use shell scripts to uncomment blocks during e2e tests (example here).
    • Update CI workflows to validate the new behavior where the tool handles uncommenting automatically.

Benefits

  • Users will no longer need to manually uncomment code in kustomization.yaml when scaffolding webhooks.
  • Cleaner and more automated CI processes.
  • Improved developer experience for kubebuilder users.
  • Improve maintainability for our ci

Extra Labels

No response

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.priority/backlogHigher priority than priority/awaiting-more-evidence.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions