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

Allow existing but empty resource names #652

Closed
wants to merge 6 commits into from
Closed

Allow existing but empty resource names #652

wants to merge 6 commits into from

Conversation

fassmus
Copy link
Contributor

@fassmus fassmus commented Dec 20, 2018

Hi,

This PR fixes #627. The validation now checks if metadata.name is available but allows empty string.

Best regards,
Florian

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 20, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fassmus
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: grodrigues3

If they are not already assigned, you can assign the PR to them by writing /assign @grodrigues3 in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 20, 2018
* 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
@Liujingfang1
Copy link
Contributor

please rebase

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 20, 2018
@Liujingfang1
Copy link
Contributor

@fassmus Can you also take a look at #641, #596? I feel they are all related to the same problem.

@monopole
Copy link
Contributor

#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.

@fassmus
Copy link
Contributor Author

fassmus commented Jan 11, 2019

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.

@fassmus fassmus closed this Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow empty resource names in base templates
5 participants