The config/crd/kustomization.yaml file should contain only one entry for the webhook patch, regardless of the number of versions for the same kind. The path should only be added if it is not already present.
The implementation to add the value with the marker is here:
What broke? What's expected?
When creating multiple versions for the same kind, in the config/crd/kustomization.yaml, there are duplicate entries for the webhook patch path:
The config/crd/kustomization.yaml file should contain only one entry for the webhook patch, regardless of the number of versions for the same kind. The path should only be added if it is not already present.
The implementation to add the value with the marker is here:
https://github.com/kubernetes-sigs/kubebuilder/blob/e3ebfafde3b7ac81588ee7c30c93b75494334dec/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go#L92-L95
Reproducing this issue
KubeBuilder (CLI) Version
master
PROJECT version
No response
Plugin versions
Other versions
No response
Extra Labels
No response