fix(cli): inherit provisioner tags from last template version (#13462)

This commit is contained in:
Marcin Tojek
2024-06-04 13:59:54 +02:00
committed by GitHub
parent e527bc6242
commit cd32c42699
4 changed files with 151 additions and 3 deletions

View File

@ -100,6 +100,16 @@ func (r *RootCmd) templatePush() *serpent.Command {
return err
}
// If user hasn't provided new provisioner tags, inherit ones from the active template version.
if len(tags) == 0 && template.ActiveVersionID != uuid.Nil {
templateVersion, err := client.TemplateVersion(inv.Context(), template.ActiveVersionID)
if err != nil {
return err
}
tags = templateVersion.Job.Tags
inv.Logger.Info(inv.Context(), "reusing existing provisioner tags", "tags", tags)
}
userVariableValues, err := ParseUserVariableValues(
varsFiles,
variablesFile,