Previously, when one set --show-only and --output-dir together, helm template
would throw an error and all files were rendered.
Refactor some of the code so that manifests and hooks are filtered in a central
location and only render manifests and hooks that match --show-only.
Additionally, use StringSliceVarP for the --show-only flag.
Fixes#9722
Signed-off-by: Andreas Karis <ak.karis@gmail.com>
f.StringArrayVarP(&showFiles,"show-only","s",[]string{},"only show manifests rendered from the given templates")
f.StringSliceVarP(&client.FileFilter,"show-only","s",[]string{},"only show manifests rendered from the given templates")
f.StringVar(&client.OutputDir,"output-dir","","writes the executed templates to files in output-dir instead of stdout")
f.BoolVar(&validate,"validate",false,"validate your manifests against the Kubernetes cluster you are currently pointing at. This is the same validation performed on an install")
f.BoolVar(&includeCrds,"include-crds",false,"include CRDs in the templated output")