Repository navigation
feat(helm): Detailed exit code for helm plugins - #4367
Merged
Merged
Conversation
mumoshu
commented
Jul 20, 2018
| cmd := newRootCmd(os.Args[1:]) | ||
| if err := cmd.Execute(); err != nil { | ||
| os.Exit(1) | ||
| switch e := err.(type) { |
Contributor
Author
There was a problem hiding this comment.
This should be an idiomatic way for this kind of switch as explained in pkg/errors#73 (comment)
mumoshu
commented
Jul 20, 2018
| if eerr, ok := err.(*exec.ExitError); ok { | ||
| os.Stderr.Write(eerr.Stderr) | ||
| return fmt.Errorf("plugin %q exited with error", md.Name) | ||
| status := eerr.Sys().(syscall.WaitStatus) |
Contributor
Author
There was a problem hiding this comment.
Even though this sounds like *unix, it works on windows too.
Member
|
Trying to trick the CLA bot into re-running the check by adding the string "I signed it" into the comment body. |
mumoshu
added a commit
to mumoshu/helm-diff
that referenced
this pull request
Jul 25, 2018
This feature is enabled only when the `--detailed-exitcode` flag (databus23#65) is provided. Supports `upgrade`, `revision` and `rollback` sub-commands. Resolves databus23#54, but only after helm/helm#4367 as released with helm v2.11.0, probably.
mumoshu
added a commit
to mumoshu/helm-diff
that referenced
this pull request
Jul 25, 2018
This feature is enabled only when the `--detailed-exitcode` flag (databus23#65) is provided. Supports `upgrade`, `revision` and `rollback` sub-commands. Resolves databus23#54, but only after helm/helm#4367 is released with helm v2.11.0, probably.
mumoshu
added a commit
to mumoshu/helm-diff
that referenced
this pull request
Jul 25, 2018
This feature is enabled only when the `--detailed-exitcode` flag (databus23#65) is provided. Supports `upgrade`, `revision` and `rollback` sub-commands. Resolves databus23#54, but only after helm/helm#4367 is released with helm v2.11.0, probably.
mumoshu
added a commit
to databus23/helm-diff
that referenced
this pull request
Jul 25, 2018
This feature is enabled only when the `--detailed-exitcode` flag (#65) is provided. Supports `upgrade`, `revision` and `rollback` sub-commands. Resolves #54, but only after helm/helm#4367 is released with helm v2.11.0, probably.
mumoshu
added a commit
to mumoshu/helmfile
that referenced
this pull request
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: ```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).
splisson
pushed a commit
to splisson/helm
that referenced
this pull request
Dec 6, 2018
Resolves helm#4170 Signed-off-by: Sebastien Plisson <[email protected]>
splisson
pushed a commit
to splisson/helm
that referenced
this pull request
Dec 6, 2018
Resolves helm#4170 Signed-off-by: Sebastien Plisson <[email protected]>
splisson
pushed a commit
to splisson/helm
that referenced
this pull request
Dec 6, 2018
splisson
pushed a commit
to splisson/helm
that referenced
this pull request
Dec 6, 2018
jianghang8421
pushed a commit
to jianghang8421/helm
that referenced
this pull request
Feb 17, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #4170