Skip to content

Instantly share code, notes, and snippets.

@voor
Created May 21, 2022 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voor/234e08ff06f3e14eb2e0a1c3a8630862 to your computer and use it in GitHub Desktop.
Save voor/234e08ff06f3e14eb2e0a1c3a8630862 to your computer and use it in GitHub Desktop.
Some hackery to make it easier to define things you want to iterate over.
#@ load("@ytt:struct", "struct")
#@ load("@ytt:yaml", "yaml")
#@ def stuff():
crd:
- group: cert-manager.io
kind: ClusterIssuer
version: v1
- group: secretgen.carvel.dev
kind: SecretExport
version: v1alpha1
- group: secretgen.carvel.dev
kind: SecretExport
version: v1alpha1
#@ end
#@ later_crds = struct.encode(yaml.decode(yaml.encode(stuff()))).crd
#@ for later_crd in later_crds:
---
sample: #@ later_crd.group
#@ end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment