FairwindsOps / rok8s-scripts

Opinionated scripts for managing application deployment lifecycle in Kubernetes
https://fairwinds.com
Apache License 2.0
299 stars 76 forks source link

Extra debugging info from `k8s-read-config` bleeds into other commands #260

Closed ebachle closed 5 years ago

ebachle commented 5 years ago

Extra debugging info from k8s-read-config causes helm-template to return debugging info before YAML. The debugging info then conflicts with programs like kubeval

The example of what's returned is something like this:

$ helm-template -f deploy/${CI_ENV}/config.env

[SOPS_SECRETS]: staging/enhanced-images-cron-env
[SOPS_SECRET_FILES]: /root/project/deploy/staging/enhanced-images-cron-env.secret.sops.yml
---
here goes yaml

The result when piped to kubeval looks something like:

bash-4.4# helm-template -f deploy/${CI_ENV}/config.env | kubeval
1 error occurred:
    * Failed to decode YAML from stdin

The echoed values come from https://github.com/reactiveops/rok8s-scripts/blob/master/bin/k8s-read-config#L72 and https://github.com/reactiveops/rok8s-scripts/blob/master/bin/k8s-read-config#L87 which do not use the rok8s_echo function which respects the LOG_LEVEL directive.

ebachle commented 5 years ago

Edited the original because helm-template has no need for ROK8S_HELM_DEPLOY_EXTRAARGS

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.