Skip to content

Conversation

@mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Jul 25, 2018

Adds the --detailed-exitcode to the helmfile diff command to return 1 on failure, and 2 when no error but diff is seen.

This feature requires the latest helm-diff containing databus23/helm-diff#78, and helm containing helm/helm#4367.

This is verified to work by manually running commands like the followings:

./helmfile --helm-binary helm211dev -f ./examples/helmfile.d diff --detailed-exitcode; echo $?
./helmfile --helm-binary helm211dev -f ./examples/helmfile.d diff; echo $?

Note that, in above example commands, helm211dev is a custom helm binary that is built from helm's master branch containing the necessary enhancement to allow propagate non-zero plugin exit code.

Adds the `--detailed-exitcode` to the `helmfile diff` command to return `1` on failure, and `2` when no error but diff is seen.

This feature requires the latest `helm-diff` containing databus23/helm-diff#78, and `helm` containing helm/helm#4367.

This is verified to work by manually running commands like the followings:

```bash
./helmfile --helm-binary helm211dev -f ./examples/helmfile.d diff --detailed-exitcode; echo $?
./helmfile --helm-binary helm211dev -f ./examples/helmfile.d diff; echo $?
```

Note that, in above example commands, `helm211dev` is a custom `helm` binary that is built from helm's master branch containing [the necessary enhancement to allow propagate non-zero plugin exit code](helm/helm#4367).
@mumoshu
Copy link
Collaborator Author

mumoshu commented Jul 25, 2018

For anyone interested, this also works with helm-tiller w/ rimusz/helm-tiller#2 when you run it this way 😉

helm211dev tiller run -- $(pwd)/helmfile --log-level debug --helm-binary helm211dev -f $(pwd)/examples/helmfile.d diff --detailed-exitcode; echo $?
# echoes "2" when there's diff

Note that helm/helm#4367 is also required for helm-tiller, in order to propagate the exit code 2 from helmfile diff --detailed-exitcode.

@mumoshu mumoshu merged commit 6be52bf into roboll:master Aug 3, 2018
@mumoshu mumoshu deleted the optional-detailed-exitcode-for-diff branch August 3, 2018 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant