Skip to content

Commit

Permalink
adding --show-diff option. #106
Browse files Browse the repository at this point in the history
  • Loading branch information
sami-alajrami committed Oct 22, 2018
1 parent b7edf55 commit 3f738fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions decision_maker.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func inspectUpgradeScenario(r *release, rs releaseState) {
} else {
if diff := diffRelease(r); diff != "" {
upgradeRelease(r)
logDecision("DECISION: release [ "+r.Name+" ] is desired to be enabled and is currently enabled. "+
logDecision("DECISION: release [ "+r.Name+" ] is currently enabled and have some changed parameters. "+
"I will upgrade it!", r.Priority)
} else {
logDecision("DECISION: release [ "+r.Name+" ] is desired to be enabled and is currently enabled. "+
Expand Down Expand Up @@ -232,7 +232,9 @@ func diffRelease(r *release) string {
if exitCode, msg = cmd.exec(debug, verbose); exitCode != 0 {
logError("Command returned with exit code: " + string(exitCode) + ". And error message: " + msg)
} else {
fmt.Println(msg)
if verbose || showDiff {
fmt.Println(msg)
}
}

return msg
Expand Down
1 change: 1 addition & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func init() {
flag.BoolVar(&skipValidation, "skip-validation", false, "skip desired state validation")
flag.BoolVar(&applyLabels, "apply-labels", false, "apply Helmsman labels to Helm state for all defined apps.")
flag.BoolVar(&keepUntrackedReleases, "keep-untracked-releases", false, "keep releases that are managed by Helmsman and are no longer tracked in your desired state.")
flag.BoolVar(&showDiff, "show-diff", false, "show helm diff results. Can expose sensitive information.")

flag.Usage = printUsage
flag.Parse()
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var pwd string
var relativeDir string
var dryRun bool
var destroy bool
var showDiff bool

func main() {
// set the kubecontext to be used Or create it if it does not exist
Expand Down

0 comments on commit 3f738fe

Please sign in to comment.