fluxcd / flux2-kustomize-helm-example

A GitOps workflow example for multi-env deployments with Flux, Kustomize and Helm.
https://fluxcd.io
Apache License 2.0
961 stars 1.03k forks source link

Fix validate script to capture pipestatus #8

Closed raphapr closed 3 years ago

raphapr commented 3 years ago

when kustomize build gets error, kubeval recognizes the output as empty YAML and gives PASS. use PIPESTATUS to properly capture exit status of piped command as workaround.

things like that could happen:

$ kustomize build blabla.yaml | kubeval
Error: error creating new loader with git: url lacks orgRepo: blabla.yaml, dir: evalsymlink failure on 'blabla.yaml' : lstat /home/raphael/repos/flux2-kustomize-helm-example/blabla.yaml: no such file or directory, get: invalid source string: blabla.yaml
PASS - stdin contains an empty YAML document
raphapr commented 3 years ago

@stefanprodan no problem. sent a PR there https://github.com/fluxcd/flux2-multi-tenancy/pull/9