-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Allow existing but empty resource names #652
Allow existing but empty resource names #652
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fassmus If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* support List of strategic merge patches * add test for List of patches * handle List in SliceFromBytes * add test for List of patches with anchor/reference * reorganize kunstruct validate
please rebase |
…ub.com/fassmus/kustomize into AllowEmptyResourceNamesInBaseTemplates
#627 is a feature request, not a bug, and it's not clear that it's a desirable feature. Names are an important part of the k8s api, and kustomize has an informal notion that all bases should "work" if applied to a cluster, so allowing empty base names just to allow the namePrefix field in an overlay to fully specify a name seems too clever and contrary to the notion of a functional base. FWIW, #596 is fixed and unrelated to this. #641 is related, in that the name field is expected to be empty - but only if there's a generateName directive. That's a different situation, and it's true that kustomize doesn't handle this at time of writing. |
I agree, using prefix for overwriting names is a bit of a hack. We decided to simply user generic names in the base layer with prefix in the overlay. Now objects created from different overlays all have the same "postfix" (name from the base) but this is not really an issue. Only for Service objects where the name is relevant at runtime of the application (DNS), we use a JSON patch in the overlay for setting the name to some desired value. Therefore, I will retract the PR. |
Hi,
This PR fixes #627. The validation now checks if metadata.name is available but allows empty string.
Best regards,
Florian