fix(cmd): Add message about deprecated chart (#6889)

Signed-off-by: Alexander Sharov <kvendingoldo@yandex.ru>
pull/7423/head
kvendingoldo 5 years ago committed by Matt Butcher
parent 7f8d258cb8
commit b88a28a25f
No known key found for this signature in database
GPG Key ID: DCD5F5E5EF32C345

@ -17,6 +17,7 @@ limitations under the License.
package main
import (
"fmt"
"io"
"time"
@ -181,6 +182,10 @@ func runInstall(args []string, client *action.Install, valueOpts *values.Options
return nil, err
}
if chartRequested.Metadata.Deprecated {
fmt.Fprintln(out, "WARNING: This chart is deprecated")
}
if req := chartRequested.Metadata.Dependencies; req != nil {
// If CheckDependencies returns an error, we have unfulfilled dependencies.
// As of Helm 2.4.0, this is treated as a stopping condition:

@ -183,6 +183,12 @@ func TestInstall(t *testing.T) {
wantError: true,
golden: "output/subchart-schema-cli-negative.txt",
},
// Install deprecated chart
{
name: "install with warning about deprecated chart",
cmd: "install aeneas testdata/testcharts/deprecated --namespace default",
golden: "output/deprecated-chart.txt",
},
}
runTestActionCmd(t, tests)

@ -0,0 +1,7 @@
WARNING: This chart is deprecated
NAME: aeneas
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

@ -0,0 +1,8 @@
apiVersion: v1
description: Deprecated testing chart
home: https://helm.sh/helm
name: deprecated
sources:
- https://github.com/helm/helm
version: 0.1.0
deprecated: true

@ -0,0 +1,3 @@
#Deprecated
This space intentionally left blank.

@ -127,6 +127,10 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
}
}
if ch.Metadata.Deprecated {
fmt.Fprintln(out, "WARNING: This chart is deprecated")
}
rel, err := client.Run(args[0], ch, vals)
if err != nil {
return errors.Wrap(err, "UPGRADE FAILED")

Loading…
Cancel
Save