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

reference values from overlay subsets #933

Open
Nizar-opt opened this issue Nov 29, 2024 · 2 comments
Open

reference values from overlay subsets #933

Nizar-opt opened this issue Nov 29, 2024 · 2 comments
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@Nizar-opt
Copy link

Describe the problem/challenge you have
I'm trying to set a label on multiple resources but with a dynamic value that includes the resource name.

#@ load("@ytt:overlay", "overlay")

#@overlay/match expects="0+", by=overlay.subset({"kind": "Deployment"})
---
metadata:
 #@overlay/match missing_ok=True
 labels:
  #@overlay/match missing_ok=True
  foo: <deployment.metadata.name>-bar #! <---------- dynamically set metadata.name of the same matching resource

Describe the solution you'd like
I want to be able to reference a value from overlay subsets.

Anything else you would like to add:


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@Nizar-opt Nizar-opt added carvel triage This issue has not yet been triaged for relevance enhancement This issue is a feature request labels Nov 29, 2024
@mamachanko
Copy link
Contributor

@Nizar-opt If I have not misunderstood the scenario, you should be able to achieve the desired outcome with @overlays/replace. It does require you to do careful merging of resources, but it's possible. I created an example in the playground for you which updates deployments with a label referencing .metadata.name.

@Nizar-opt
Copy link
Author

Thank you @mamachanko appreciate the example. It worked for my case. Not sure if this is considered an alternative solution? As the proposed feature may cover other cases? cc @cppforlife

@renuy renuy added carvel accepted This issue should be considered for future work and that the triage process has been completed and removed carvel triage This issue has not yet been triaged for relevance labels Dec 6, 2024
@renuy renuy moved this to Unprioritized in Carvel Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
Status: Unprioritized
Development

No branches or pull requests

3 participants