-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
kustomize not able to reject a resource with name field during replacement #5169
Comments
This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Please add Like below example.
Your deployments are missing |
This suggestion is doing the opposite of what we're looking for, we don't want httpGet to be the part of final output for test-app2 (check below output). The
|
I understand what you want to do. example
|
I've also run into this issue, and I think it's because the ordering of operations is difficult to ascertain. Do replacements get applied before/after a patch? For example, if I have a source and want to target a ie. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What happened?
In my base configuration I have a deployment object which has a http based health check probes. I've a requirement to kustomize this deployment object for one of my app (test-app2) & replace it with tcp health check.
We've a common replacement file shared by all the apps (
/apps/common/internal/replacement.yaml
), and there we are renaming part of the http health check endpoint with the app name. (Assume that most of our application have http health check only and only one or two app will have this special requirement of having a tcp health check).In the test-app2 (where we want tcp health checks), we're first adding a patch to add tcp health check and another patch to remove http health check. But as soon as the http health check is removed by the patch, the field is referenced/referred by replacement.yaml and hence we see this error -
In order to overcome this issue, we saw that in replacement object we can use
reject
to exclude a resource but somehow it is not working for us and we're still seeing the same above error.As you can see that we want replacement to happen for all the deployment object excluding where name is
test-app2
(where we want tcp health check), but we're seeing error.What did you expect to happen?
We want
reject
section in replacement block to exclude the resource with the given name and only apply the replacement to all the selected resource except those mentioned in reject block.How can we reproduce it (as minimally and precisely as possible)?
Git Repo - https://github.com/mdfaizsiddiqui/kustomize-bug/tree/main
Execute -
Expected output
Expected output should have test-app2 probes to only have tcp health check like -
Actual output
We're seeing error -
Kustomize version
v5.0.2
Operating system
MacOS
The text was updated successfully, but these errors were encountered: