Comments (2)
I'd like to appreciate the detailed documentation you provided for the project. If I had been more careful, I'd have noticed the sources
parameter before. Thank you!
from hull.
Hi @khmarochos,
if I understand correctly you want to create an arbitrary number of properties via a transformation and add them to an (arbitrary) dictionary having the possibility to specify additional keys as well?
If so, that is not possible directly but can be done I think. I'll try to explain using the pod
dictionary from above:
Let's assume you have a deployment like this:
hull:
objects:
deployment:
example:
pod:
containers:
main:
image:
repository: somerepo
tag: "latest"
and you want to add some additional properties dynamically to the pod
. At the moment there is no way to do that on the pod
itself, transformations normally fully replace values and not add key-values to dicts where they are used.
But you can utilize the sources
feature for this I think. If you put a transformation for the pod
value in another object you don't render but reference as a source
, this transformation is evaluated first and afterwards merged with the object which references it as a source under sources
:
hull:
objects:
deployment:
pod-values:
enabled: false
pod: |-
_HT!{
"replicas": 5
}
example:
sources:
- pod-values
pod:
containers:
main:
image:
repository: somerepo
tag: "latest"
So pod
in pod-values
is evaluated to replicas: 5
and this replicas: 5
is merged to the definition of example
. pod-values
deployment is disabled and will not be rendered at all.
In the end you have in the example
deployment:
...
spec:
containers:
- env: []
envFrom: []
image: somerepo:latest
name: main
ports: []
volumeMounts: []
imagePullSecrets:
- name: release-name-hull-test-example-registry
- name: release-name-hull-test-local-registry
initContainers: []
replicas: 5
serviceAccountName: release-name-hull-test-default
volumes: []
Hope it brings the idea across, more information on sources
is here.
Quite late now so can't add more info at the moment. If you need more support please let me know and I will get back to you right after christmas days. Thanks.
from hull.
Related Issues (20)
- Bug: Ingress with TLS HOT 4
- Quoted values transformed to scientific notation number HOT 4
- Using transformations in objects' names HOT 2
- Empty list in hull.util.transformation.include HOT 8
- Using transformations in hull.objects.secret.*.data.*.inline HOT 13
- Something is wrong when using a transformation in hull.objects.ingress.*.tls.*.hosts HOT 3
- The hull.util.transformation.makefullname transformation and and the staticName parameter HOT 9
- Creating non-opaque Secrets HOT 6
- hull.util.transformation.get converts a string to an integer HOT 3
- Empty fields in rendered template HOT 5
- Accessing the global context from an interpolation placeholder HOT 7
- Is there an idiomatic way to access Chart and Release objects HOT 7
- Add more single valued functions to `_HT*` transformations HOT 1
- Add `sharedContainers` feature
- Enable array access in `_HT*` HOT 1
- Default security settings
- [question] Is it possible to create ConfigMap from a directory using glob pattern ? HOT 20
- Cronjob jobspec not mapping several fields HOT 2
- Combine boolean evaluation `_HT?` with get `_HT*` and include `_HT/` transformations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hull.