From 01bcae7263c40f151491f2b56944d3b2dde660ad Mon Sep 17 00:00:00 2001 From: Stanton Xu Date: Sat, 6 Jun 2020 17:21:06 -0700 Subject: [PATCH] Add Warning when installing or upgrading a deprecated chart Signed-off-by: Stanton Xu --- cmd/helm/install.go | 5 +++++ cmd/helm/upgrade.go | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 117c7ba5b..784f041c4 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -267,6 +267,11 @@ func (i *installCmd) run() error { return prettyError(err) } + if chartRequested.Metadata.Deprecated { + fmt.Fprintln(out, "WARNING: This chart is deprecated") + } + + if req, err := chartutil.LoadRequirements(chartRequested); err == nil { // If checkDependencies returns an error, we have unfulfilled dependencies. // As of Helm 2.4.0, this is treated as a stopping condition: diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 6b885ba63..d3ff163d4 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -266,6 +266,10 @@ func (u *upgradeCmd) run() error { return prettyError(err) } + if ch.Metadata.Deprecated { + fmt.Fprintln(out, "WARNING: This chart is deprecated") + } + resp, err := u.client.UpdateReleaseFromChart( u.release, ch,