Skip to content

Commit bc91dc3

Browse files
committed
update for 3.14.3
1 parent 37975b3 commit bc91dc3

30 files changed

Lines changed: 305 additions & 27 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GOBIN = $(shell go env GOPATH)/bin
1111
endif
1212
GOX = $(GOBIN)/gox
1313
GOIMPORTS = $(GOBIN)/goimports
14-
ARCH = $(shell uname -p)
14+
ARCH = $(shell go env GOARCH)
1515

1616
ACCEPTANCE_DIR:=../acceptance-testing
1717
# To specify the subset of acceptance tests to run. '.' means all tests

cmd/helm/install.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ And in the following example, 'foo' is set to '{"key1":"value1","key2":"bar"}':
9494
$ helm install --set-json='foo={"key1":"value1","key2":"value2"}' --set-json='foo.key2="bar"' myredis ./redis
9595
9696
To check the generated manifests of a release without installing the chart,
97-
the '--debug' and '--dry-run' flags can be combined.
97+
the --debug and --dry-run flags can be combined.
98+
99+
The --dry-run flag will output all generated chart manifests, including Secrets
100+
which can contain sensitive values. Please carefully consider how and when this
101+
flag is used.
98102
99103
If --verify is set, the chart MUST have a provenance file, and the provenance
100104
file MUST pass all verification steps.

cmd/helm/upgrade.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ parameters, and existing values will be merged with any values set via '--values
7272
or '--set' flags. Priority is given to new values.
7373
7474
$ helm upgrade --reuse-values --set foo=bar --set foo=newbar redis ./redis
75+
76+
The --dry-run flag will output all generated chart manifests, including Secrets
77+
which can contain sensitive values. Please carefully consider how and when this
78+
flag is used.
7579
`
7680

7781
func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ go 1.21
44

55
require (
66
github.com/BurntSushi/toml v1.3.2
7-
github.com/DATA-DOG/go-sqlmock v1.5.0
7+
github.com/DATA-DOG/go-sqlmock v1.5.2
88
github.com/Masterminds/semver/v3 v3.2.1
99
github.com/Masterminds/sprig/v3 v3.2.3
1010
github.com/Masterminds/squirrel v1.5.4
1111
github.com/Masterminds/vcs v1.13.3
1212
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535
13-
github.com/containerd/containerd v1.7.11
13+
github.com/containerd/containerd v1.7.12
1414
github.com/cyphar/filepath-securejoin v0.2.4
1515
github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2
1616
github.com/evanphx/json-patch v5.7.0+incompatible

go.sum

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg6
66
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
77
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
88
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
9-
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
10-
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
9+
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
10+
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
1111
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
1212
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
1313
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
@@ -58,8 +58,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
5858
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
5959
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
6060
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
61-
github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw=
62-
github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE=
61+
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=
62+
github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=
6363
github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM=
6464
github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
6565
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
@@ -230,6 +230,7 @@ github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA
230230
github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
231231
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
232232
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
233+
github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE=
233234
github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=
234235
github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
235236
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dev/null

pkg/chart/metadata.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
package chart
1717

1818
import (
19+
"path/filepath"
1920
"strings"
2021
"unicode"
2122

@@ -110,6 +111,11 @@ func (md *Metadata) Validate() error {
110111
if md.Name == "" {
111112
return ValidationError("chart.metadata.name is required")
112113
}
114+
115+
if md.Name != filepath.Base(md.Name) {
116+
return ValidationErrorf("chart.metadata.name %q is invalid", md.Name)
117+
}
118+
113119
if md.Version == "" {
114120
return ValidationError("chart.metadata.version is required")
115121
}

pkg/chart/metadata_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ func TestValidate(t *testing.T) {
4040
&Metadata{APIVersion: "v2", Version: "1.0"},
4141
ValidationError("chart.metadata.name is required"),
4242
},
43+
{
44+
"chart without name",
45+
&Metadata{Name: "../../test", APIVersion: "v2", Version: "1.0"},
46+
ValidationError("chart.metadata.name \"../../test\" is invalid"),
47+
},
4348
{
4449
"chart without version",
4550
&Metadata{Name: "test", APIVersion: "v2"},

pkg/chartutil/errors.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,11 @@ type ErrNoValue struct {
3333
}
3434

3535
func (e ErrNoValue) Error() string { return fmt.Sprintf("%q is not a value", e.Key) }
36+
37+
type ErrInvalidChartName struct {
38+
Name string
39+
}
40+
41+
func (e ErrInvalidChartName) Error() string {
42+
return fmt.Sprintf("%q is not a valid chart name", e.Name)
43+
}

pkg/chartutil/save.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ var headerBytes = []byte("+aHR0cHM6Ly95b3V0dS5iZS96OVV6MWljandyTQo=")
3939
// directory, writing the chart's contents to that subdirectory.
4040
func SaveDir(c *chart.Chart, dest string) error {
4141
// Create the chart directory
42+
err := validateName(c.Name())
43+
if err != nil {
44+
return err
45+
}
4246
outdir := filepath.Join(dest, c.Name())
4347
if fi, err := os.Stat(outdir); err == nil && !fi.IsDir() {
4448
return errors.Errorf("file %s already exists and is not a directory", outdir)
@@ -149,6 +153,10 @@ func Save(c *chart.Chart, outDir string) (string, error) {
149153
}
150154

151155
func writeTarContents(out *tar.Writer, c *chart.Chart, prefix string) error {
156+
err := validateName(c.Name())
157+
if err != nil {
158+
return err
159+
}
152160
base := filepath.Join(prefix, c.Name())
153161

154162
// Pull out the dependencies of a v1 Chart, since there's no way
@@ -242,3 +250,15 @@ func writeToTar(out *tar.Writer, name string, body []byte) error {
242250
_, err := out.Write(body)
243251
return err
244252
}
253+
254+
// If the name has directory name has characters which would change the location
255+
// they need to be removed.
256+
func validateName(name string) error {
257+
nname := filepath.Base(name)
258+
259+
if nname != name {
260+
return ErrInvalidChartName{name}
261+
}
262+
263+
return nil
264+
}

0 commit comments

Comments
 (0)