Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.

allow override of "stdin" filename #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

allow override of "stdin" filename #13

wants to merge 1 commit into from

Conversation

jsleeio
Copy link

@jsleeio jsleeio commented Jan 9, 2018

what is this PR doing?

added a commandline option --filename to allow overriding the stdin filename displayed when accepting manifests from standard input

why is it useful/desireable?

I have a loop that kinda looks like the below (pseudo)shell example. A Helm template is rendered to a temporary file (greatly simplified here for brevity) so that the test output displays a filename for any failed tests.

The --filename option provided by this PR allows me to delete all the temporary file handling (mktemp etc) and simply pipe the output of helm template ... directly to kubetest.

#!/bin/sh
rc=0
cd $HELM_CHART
for values in envs/*yaml; do
  for template in templates/*yaml; do
    helm template . -x $template -f $values > temporary.yaml
    if ! kubetest -t $TESTS temporary.yaml ; then
      rc=1
    fi
    rm -f temporary.yaml
  done
done
exit $rc

behavioural changes

The default behaviour of kubetest is not affected by this PR.

@princerachit
Copy link

Can you retrigger the build?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants