+36
-0
lines changedFilter options
+36
-0
lines changed Original file line number Diff line number Diff line change
@@ -267,6 +267,10 @@ func (i *installCmd) run() error {
267
267
return prettyError(err)
268
268
}
269
269
270
+
if chartRequested.Metadata.Deprecated {
271
+
fmt.Fprintln(os.Stderr, "WARNING: This chart is deprecated")
272
+
}
273
+
270
274
if req, err := chartutil.LoadRequirements(chartRequested); err == nil {
271
275
// If checkDependencies returns an error, we have unfulfilled dependencies.
272
276
// As of Helm 2.4.0, this is treated as a stopping condition:
Original file line number Diff line number Diff line change
@@ -207,6 +207,14 @@ func TestInstall(t *testing.T) {
207
207
resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "virgil"}),
208
208
expected: "info:\n Description: Release mock\n first_deployed:\n seconds: 242085845\n last_deployed:\n seconds: 242085845\n status:\n code: 1\nname: virgil\nnamespace: default\n",
209
209
},
210
+
// Install deprecated chart
211
+
{
212
+
name: "install with warning about deprecated chart",
213
+
args: []string{"testdata/testcharts/deprecatedchart"},
214
+
flags: []string{"--name", "deprecatedchart"},
215
+
resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "deprecatedchart"}),
216
+
expected: "deprecatedchart",
217
+
},
210
218
}
211
219
212
220
runReleaseCases(t, tests, func(c *helm.FakeClient, out io.Writer) *cobra.Command {
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
1
+
apiVersion: v1
2
+
description: Deprecated testing chart
3
+
home: https://helm.sh/helm
4
+
name: deprecatedchart
5
+
sources:
6
+
- https://github.com/helm/helm
7
+
version: 0.1.0
8
+
deprecated: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1
+
#Deprecated
2
+
3
+
This space intentionally left blank.
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ package main
19
19
import (
20
20
"fmt"
21
21
"io"
22
+
"os"
22
23
"strings"
23
24
24
25
"github.com/spf13/cobra"
@@ -266,6 +267,10 @@ func (u *upgradeCmd) run() error {
266
267
return prettyError(err)
267
268
}
268
269
270
+
if ch.Metadata.Deprecated {
271
+
fmt.Fprintln(os.Stderr, "WARNING: This chart is deprecated")
272
+
}
273
+
269
274
resp, err := u.client.UpdateReleaseFromChart(
270
275
u.release,
271
276
ch,
Original file line number Diff line number Diff line change
@@ -85,6 +85,7 @@ func TestUpgradeCmd(t *testing.T) {
85
85
originalDepsPath := filepath.Join("testdata/testcharts/reqtest")
86
86
missingDepsPath := filepath.Join("testdata/testcharts/chart-missing-deps")
87
87
badDepsPath := filepath.Join("testdata/testcharts/chart-bad-requirements")
88
+
deprecatedChart := filepath.Join("testdata/testcharts/deprecatedchart")
88
89
var ch3 *chart.Chart
89
90
ch3, err = chartutil.Load(originalDepsPath)
90
91
if err != nil {
@@ -183,6 +184,13 @@ func TestUpgradeCmd(t *testing.T) {
183
184
resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "bonkers-bunny", Version: 1, Chart: ch3}),
184
185
err: true,
185
186
},
187
+
{
188
+
name: "upgrade a release with deprecated chart",
189
+
args: []string{"crazy-bunny", deprecatedChart},
190
+
resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 2, Chart: ch}),
191
+
expected: "Release \"crazy-bunny\" has been upgraded.\n",
192
+
rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "crazy-bunny", Version: 2, Chart: ch})},
193
+
},
186
194
}
187
195
188
196
cmd := func(c *helm.FakeClient, out io.Writer) *cobra.Command {
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4