From cb432199089ff4a1354a59fd23fd5f5294a8c54d Mon Sep 17 00:00:00 2001 From: natto1784 Date: Sun, 6 Feb 2022 23:48:18 +0530 Subject: [PATCH] added option to turn off templating --- models.go | 1 + out/main.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/models.go b/models.go index ea720d7..958a8f4 100644 --- a/models.go +++ b/models.go @@ -6,6 +6,7 @@ type Source struct { Token string `json:"token"` ConsulToken string `json:"consul_token"` VaultToken string `json:"vault_token"` + Templating bool `json:"templating"` } type JobVersion struct { diff --git a/out/main.go b/out/main.go index 63283ce..f4559d0 100644 --- a/out/main.go +++ b/out/main.go @@ -45,6 +45,7 @@ func main() { templPath := filepath.Join(sourceDir, config.Params.JobPath) templFile, err := ioutil.ReadFile(templPath) common.Check(err, "Could not read input file "+templPath) + if ( config.Source.Templating != false ) { tmpl, err := template.New("job").Parse(string(templFile)) common.Check(err, "Error parsing template") @@ -65,6 +66,7 @@ func main() { defer outFile.Close() _, err = outFile.Write(buf.Bytes()) common.Check(err, "Error writing output file") + } cmd := exec.Command( "nomad",