mirror of
https://github.com/helm/helm.git
synced 2026-08-05 15:40:40 +00:00
fix(cmd): Add message about deprecated chart (#6889)
Signed-off-by: Alexander Sharov <kvendingoldo@yandex.ru>
This commit is contained in:
committed by
Martin Hickey
parent
09ebcde05c
commit
0fd76b2a2b
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
@@ -182,6 +183,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)
|
||||
|
||||
7
cmd/helm/testdata/output/deprecated-chart.txt
vendored
Normal file
7
cmd/helm/testdata/output/deprecated-chart.txt
vendored
Normal file
@@ -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
|
||||
8
cmd/helm/testdata/testcharts/deprecated/Chart.yaml
vendored
Normal file
8
cmd/helm/testdata/testcharts/deprecated/Chart.yaml
vendored
Normal file
@@ -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
|
||||
3
cmd/helm/testdata/testcharts/deprecated/README.md
vendored
Normal file
3
cmd/helm/testdata/testcharts/deprecated/README.md
vendored
Normal file
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user