Skip to content

Instantly share code, notes, and snippets.

@LittleWat
Last active May 17, 2023 07:34
Show Gist options
  • Save LittleWat/ee726a8f6cefdba66148fb52074190af to your computer and use it in GitHub Desktop.
Save LittleWat/ee726a8f6cefdba66148fb52074190af to your computer and use it in GitHub Desktop.
test-ytt
```shell
$ ytt -f template.yaml -f schema.yaml -f value-a.yaml -f value-b.yaml
channels:
b.atopic: <===== This should be `a.atopic`
name: atopic
b.btopic:
name: btopic
```
#@data/values-schema
---
namespace: ""
topics:
- name: ""
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")
channels:
#@ for topic in data.values.topics:
#@yaml/text-templated-strings
(@= "{}.{}".format(data.values.namespace, topic.name) @):
name: #@ topic.name
#@ end
#@data/values
---
namespace: a
topics:
- name: atopic
#@data/values
---
namespace: b
topics:
- name: btopic
@LittleWat
Copy link
Author

$ ytt -f template.yaml -f schema.yaml -f value-a.yaml -f value-b.yaml
channels:
  b.atopic:  <===== This should be `a.atopic`
    name: atopic
  b.btopic:
    name: btopic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment