delete an entry from resources section in kustomization yaml #1949
venki231blr
started this conversation in
General
Replies: 2 comments
-
So close, just drop the "- " as that's not part of the value, it's just yaml notation for an array entry
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks Mike! Appreciate the help. 👍
…On Thu, Feb 15, 2024 at 5:57 PM Mike Farah ***@***.***> wrote:
So close, just drop the "- " as that's not part of the value, it's just
yaml notation for an array entry
yq 'del(.resources.[] | select (. == "resource2.yaml"))' kustomization.yaml
—
Reply to this email directly, view it on GitHub
<#1949 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMAPFWMDPMRBFC5QQEVKTQLYT2HG7AVCNFSM6AAAAABDIPQA5KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIOBWGQZDS>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello 👋🏼 ,
I'm trying to process a k8s kustomization.yaml and remove a matching entry completely. I could not find a native way using the kustomize tools so I figured I give yq a spin.
The part I'm interesting looks like this:
resources:
What I would like to do is remove entry in resources matching resource2, so that the document afterwards looks like this:
resources:
I thought I figure out how to only match one entry and then expand the expression to call del() on it, but I fail already the part here.
Some things I tried:
yq eval 'del(.resources.[] | select (. == "- resource2.yaml"))' kustomization.yaml => seems to be not working
😞
I'm somewhat lost here, please help me
Thank you 🙏🏼
Beta Was this translation helpful? Give feedback.
All reactions