Skip to content

Commit

Permalink
fixup: fix string output for Pair type
Browse files Browse the repository at this point in the history
Signed-off-by: Lance Ball <lball@redhat.com>
  • Loading branch information
lance committed Jul 29, 2021
1 parent 7080e02 commit ae34b39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ func (e Pair) String() string {
} else if e.Name != nil && e.Value != nil {
match := regKeyFromSecret.FindStringSubmatch(*e.Value)
if len(match) == 3 {
return fmt.Sprintf("Env \"%s\" with value set from key \"%s\" from Secret \"%s\"", *e.Name, match[2], match[1])
return fmt.Sprintf("Pair \"%s\" with value set from key \"%s\" from Secret \"%s\"", *e.Name, match[2], match[1])
}
match = regKeyFromConfigMap.FindStringSubmatch(*e.Value)
if len(match) == 3 {
return fmt.Sprintf("Env \"%s\" with value set from key \"%s\" from ConfigMap \"%s\"", *e.Name, match[2], match[1])
return fmt.Sprintf("Pair \"%s\" with value set from key \"%s\" from ConfigMap \"%s\"", *e.Name, match[2], match[1])
}
match = regLocalEnv.FindStringSubmatch(*e.Value)
if len(match) == 2 {
return fmt.Sprintf("Env \"%s\" with value set from local env variable \"%s\"", *e.Name, match[1])
return fmt.Sprintf("Pair \"%s\" with value set from local env variable \"%s\"", *e.Name, match[1])
}

return fmt.Sprintf("Env \"%s\" with value \"%s\"", *e.Name, *e.Value)
return fmt.Sprintf("Pair \"%s\" with value \"%s\"", *e.Name, *e.Value)
}
return ""
}
Expand Down

0 comments on commit ae34b39

Please sign in to comment.