Skip to content

Instantly share code, notes, and snippets.

@pivotaljohn
Last active July 19, 2022 16:46
Show Gist options
  • Save pivotaljohn/63b9e02831f1d3015a8ab7b60db7f3d5 to your computer and use it in GitHub Desktop.
Save pivotaljohn/63b9e02831f1d3015a8ab7b60db7f3d5 to your computer and use it in GitHub Desktop.
Post-processing Data Values
#@ load("@ytt:data", "data")
#@ load("@ytt:yaml", "yaml")
#@ load("@ytt:struct", "struct")
#@ profiles = struct.make(full="full", is_any_enabled=lambda p: False)
#@ def grypeValues(grype):
#@ newGrype = yaml.decode(yaml.encode(grype))
#@
#@ if not profiles.is_any_enabled([profiles.full]) and not "metadataStore" in newGrype:
#@ newGrype["metadataStore"] = {"url":""}
#@ end
#@
#@ return newGrype
#@ end
#@ grype = grypeValues(data.values.grype)
values: #@ grype
#@data/values
---
grype:
namespace: "dev"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment