Add Contextual Error Messages to RunWithContext

-e
Signed-off-by: Payal Godhani <godhanipayal@gmail.com>
pull/13538/head
Payal Godhani 9 months ago
parent a933bcc7d1
commit 34cd8341c3

@ -233,21 +233,25 @@ func (i *Install) RunWithContext(ctx context.Context, chrt *chart.Chart, vals ma
// 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
i.cfg.Log(fmt.Sprintf("ERROR: Cluster reachability check failed: %v", err))
return nil, errors.Wrap(err, "cluster reachability check failed")
}
}
// HideSecret must be used with dry run. Otherwise, return an error.
if !i.isDryRun() && i.HideSecret {
return nil, errors.New("Hiding Kubernetes secrets requires a dry-run mode")
i.cfg.Log("ERROR: Hiding Kubernetes secrets requires a dry-run mode")
return nil, errors.New("hiding Kubernetes secrets requires a dry-run mode")
}
if err := i.availableName(); err != nil {
return nil, err
i.cfg.Log(fmt.Sprintf("ERROR: Release name check failed: %v", err))
return nil, errors.Wrap(err, "release name check failed")
}
if err := chartutil.ProcessDependenciesWithMerge(chrt, vals); err != nil {
return nil, err
i.cfg.Log(fmt.Sprintf("ERROR: Processing chart dependencies failed: %v", err))
return nil, errors.Wrap(err, "chart dependencies processing failed")
}
var interactWithRemote bool

Loading…
Cancel
Save