Skip to content
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

feat: add metadata to ytt steps #119

Merged
merged 10 commits into from
Oct 30, 2023
4 changes: 4 additions & 0 deletions internal/myks/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ func (a *Application) ytt(step, purpose string, paths []string, args ...string)
}

func (a *Application) yttS(step string, purpose string, paths []string, stdin io.Reader, args ...string) (CmdResult, error) {
args = append(args,
"-v", "meta.step="+step,
"-v", "meta.app="+a.Name,
"-v", "meta.prototype="+a.Prototype)
paths = concatenate(a.e.g.extraYttPaths, paths)
return runYttWithFilesAndStdin(paths, stdin, func(name string, args []string) {
log.Debug().Msg(a.Msg(step, msgRunCmd(purpose, name, args)))
Expand Down
8 changes: 8 additions & 0 deletions internal/myks/assets/data-schema.ytt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,11 @@ myks:
gitRepoBranch: ""
#! Set to the current git repository URL if available.
gitRepoUrl: ""
#! meta data of the current rendering step
meta:
#! application name currently being rendered
app: ""
#! name of prototype including full path (e.g. prototypes/argocd)
prototype: ""
#! rendering step: argocd, global_ytt, helm, ytt-pkg, ytt
step: ""
kbudde marked this conversation as resolved.
Show resolved Hide resolved