-
Notifications
You must be signed in to change notification settings - Fork 136
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 Data in Data Values #882
Labels
discussion
This issue is not a bug or feature and a conversation is needed to find an appropriate resolution
Comments
antwacky
added
the
carvel triage
This issue has not yet been triaged for relevance
label
Nov 21, 2023
Will check today. |
sorry for delay. cat schema-values.yml. #@ load("@ytt:data", "data")
---
environment: development
domain: localhost
apps:
- name: app1
mountFiles:
- name: app-config
mountPath: /app/config.json
#@yaml/text-templated-strings
content: |
environment: (@= data.values.environment @)
url: (@= "https://app1-{}".format(data.values.domain) @)
- name: app-config
mountPath: /app/config.json
#@yaml/text-templated-strings
content: |
environment: (@= data.values.environment @)
url: (@= "https://app2-{}".format(data.values.domain) @) cat values.yml #@data/values
---
domain: somedomain
environment: someenv cat deployment.yml #@ load("@ytt:data", "data")
#@ apps = data.values.apps
---
topnode:
#@ for app in apps:
#@ for file in app.mountFiles:
- mountPath: #@ file.mountPath
name: #@ file.name.split('.')[0]
subPath: #@ file.name
#@ end
#@ end and do 2 step ytt to achieve what you want. % ytt -f values.yml -f schema-values.yml | ytt --data-values-file - -f deployment.yml
topnode:
- mountPath: /app/config.json
name: app-config
subPath: app-config
- mountPath: /app/config.json
name: app-config
subPath: app-config |
prembhaskal
added
discussion
This issue is not a bug or feature and a conversation is needed to find an appropriate resolution
and removed
carvel triage
This issue has not yet been triaged for relevance
labels
Dec 5, 2023
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
discussion
This issue is not a bug or feature and a conversation is needed to find an appropriate resolution
I know there is a work around for this, however I don't think it fits my particular use case very nicely, and wondering if there's a better solution.
So consider my schema:
Then in a deployment template:
I can then mount files to the various application deployments with variable content as needed. Obviously, this isn't possible, as it is not possible to use data values within a data values file.
If I were to use a function, then this gets messy, quickly, as I then have to put the file content in a
lib/function
, and then I have to put themountPath
somewhere seperate.For example, I then will have a lib:
And my deployment becomes:
Clearly this is not nice at all, and inflexible. How is it recommended to handle this situation?
Thanks
The text was updated successfully, but these errors were encountered: