From 3a843df1ff721e4cce75b26e8cc13ad6aed050b3 Mon Sep 17 00:00:00 2001 From: Andreas Sommer Date: Fri, 13 Sep 2019 14:14:25 +0200 Subject: [PATCH] Fix reachability check which must be disabled for `helm template` (unless `--validate` is specified) Signed-off-by: Andreas Sommer --- pkg/action/install.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/action/install.go b/pkg/action/install.go index 24006b69e..173a8b08b 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -147,8 +147,11 @@ func (i *Install) installCRDs(crds []*chart.File) error { // // If DryRun is set to true, this will prepare the release, but not install it func (i *Install) Run(chrt *chart.Chart, vals map[string]interface{}) (*release.Release, error) { - if err := i.cfg.KubeClient.IsReachable(); err != nil { - return nil, err + // Check reachability of cluster unless in client-only mode (e.g. `helm template` without `--validate`) + if !i.ClientOnly { + if err := i.cfg.KubeClient.IsReachable(); err != nil { + return nil, err + } } if err := i.availableName(); err != nil {