Skip to content

Commit

Permalink
task: Print filled pipeline values on validate & process
Browse files Browse the repository at this point in the history
  • Loading branch information
zbenhadi authored and JulesFaucherre committed Mar 3, 2023
1 parent 4983470 commit be54c96
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ func validateConfig(opts configOptions, flags *pflag.FlagSet) error {

//if no orgId provided use org slug
values := pipeline.LocalPipelineValues()
fmt.Println("Validating config with following values :\n", values)
fmt.Println("Validating config with following values")
printValues(values)

orgID, _ := flags.GetString("org-id")
if strings.TrimSpace(orgID) != "" {
response, err = api.ConfigQuery(opts.cl, path, orgID, nil, values)
Expand Down Expand Up @@ -195,7 +197,9 @@ func processConfig(opts configOptions, flags *pflag.FlagSet) error {

//if no orgId provided use org slug
values := pipeline.LocalPipelineValues()
fmt.Println("Processing config with following values: \n", values)
fmt.Println("Processing config with following values")
printValues(values)

orgID, _ := flags.GetString("org-id")
if strings.TrimSpace(orgID) != "" {
response, err = api.ConfigQuery(opts.cl, opts.args[0], orgID, params, values)
Expand Down Expand Up @@ -231,3 +235,9 @@ func packConfig(opts configOptions) error {
func migrateConfig(opts configOptions) error {
return proxy.Exec([]string{"config", "migrate"}, opts.args)
}

func printValues(values pipeline.Values) {
for key, value := range values {
fmt.Printf("\t%s:\t%s", key, value)
}
}

0 comments on commit be54c96

Please sign in to comment.