-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Why set namespace with kustomize for cluster-scoped Mutating|ValidatingWebhookConfiguration? #3999
Comments
created this issue at the request of kubernetes-sigs/controller-tools#999 (comment) despite the issue template saying to create issues in controller-tools 🤷♂️ |
It is not related to controller-tools at all. However, it seems that is a bug and the code is unnecessary.
Please, feel free to open PR with the change. |
@camilamacedo86 thanks, I'll attempt! |
Closing as it's not a bug. These lines are setting the K8s Service's namespace not that of the Mutating|ValidatingWebhookConfiguration. These lines Lines 60 to 68 in e82127c
webhooks/0/clientConfig/service/namespace value kubebuilder/testdata/project-v4/config/webhook/manifests.yaml Lines 2 to 13 in f1a4328
kustomizeconfig.yaml doesn't have an array index path segment.)
Without these lines, the namespace value will always be |
What broke? What's expected?
What "broke"
Why does kubebuilder use a namespace kustomization transformer to set a namespace for Mutating|ValidatingWebhookConfiguration if these are cluster-scoped resources? Code here
Isn't this unnecessary?
What's expected
IIUC, lines of code above shouldn't exist as they don't do anything?
Expected output
Actual output
Reproducing this issue
Run
kubebuilder create webhook --group batch --version v1 --kind CronJob --defaulting --programmatic-validation
as described in Implementing defaulting/validating webhooks.KubeBuilder (CLI) Version
4.0.0
PROJECT version
3
Plugin versions
go.kubebuilder.io/v4
Other versions
go 1.22.2
sigs.k8s.io/controller-runtime v0.18.2
kubectl version
Client Version: v1.29.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.3-gke.1282000
Extra Labels
/kind cleanup
The text was updated successfully, but these errors were encountered: