Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend helm-sops to support pass-through of exit codes returned by plugins. #4

Closed
debayande opened this issue Sep 25, 2020 · 2 comments

Comments

@debayande
Copy link

debayande commented Sep 25, 2020

helm-sops summarily returns an exit code of 1 irrespective of the error encountered (and hence, exit code generated) upstream by helm (please cf. https://git.lystit.com/lyst/helm-sops/blob/f6776ac5af1ac0b2e49b67aa6b7f1401b0c44425/main.go#L223). As a result, it breaks workflows where other tools rely on the various exit codes generated by helm to perform further actions. As an example, please consider our workflow for deploying Helm charts.

We use Helmfile to deploy Helm charts. Helmfile's USP is that it allows one to maintain declarative manifests of customisations to a chart and provides the facility to conditionally update them in a cluster. In order for the conditional part to work, Helmfile relies on helm-diff under the hood to check for deltas.

Post-execution, helm returns:

  • the exit code of the plugin if a plugin was executed or,
  • an exit code of 1 if there was an issue or of 0 if everything worked

If the plugin in question is helm-diff, then one of the following exit codes gets returned:

  • 0, if there's no error and no diff,
  • 1, if there's an error, or,
  • 2, if there no error but a diff

To tie this back to our workflow, an exit code of 2 is used by Helmfile to determine whether to (re)install a chart or not.

Now, introducing helm-sops into our workflow breaks it instantly since it gobbles up the exit code of 2 returned by helm and passes the exit code of 1 to Helmfile instead, causing it to exit with an error.

May I, therefore, request that helm-sops be extended to support pass-through of exit codes returned by plugins?

Thanks.

References

@yann-soubeyrand
Copy link
Member

Hi @debayande,

I'm also hit by this issue and plan to work on it at some time. Unfortunately, I don't have the necessary time as of now and probably won't before some weeks. Anyway, thanks for your report, I'll keep you updated when things move forward ;-)

teejaded referenced this issue in teejaded/helm-sops Nov 3, 2020
GUI pushed a commit to GUI/helm-sops that referenced this issue Nov 8, 2022
Remove unnecessary personal access token from workflow
hbollon pushed a commit that referenced this issue Jun 23, 2023
@hbollon
Copy link
Member

hbollon commented Jun 23, 2023

Fixed with the new release 👍

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 a pull request may close this issue.

3 participants