Skip to content

Commit b4fdc7e

Browse files
committed
Merge tag 'v3.21.4' into release-3.21
Helm release v3.21.4 # -----BEGIN PGP SIGNATURE----- # # iQJPBAABCAA5FiEEII3TbtW7N0WhZ0Okx8b7tbkcEVUFAmp+JikbFIAAAAAABAAO # bWFudTIsMi41KzEuMTIsMCwzAAoJEMfG+7W5HBFVQRQQAJ3+AzVfWhY/rbMJ2Xh8 # 2nJlYvMvQPgfxwnCJlzYjp2w5HKD1iMu3/3or+D77IdFTYj3qctZmlR3O2AZYR5p # MPfQRrSB3RAQdISMoza4+QaOZ3EWF4dfbrDUVO3x+GG8TQpHj4KU71k7VoJMfZOT # Yl3X7D9/1wQfI4CYucFTI6prbA7vvaRcutEaYyQ4Beblh0GZV88qe31jOihPjDlP # ndG5EogfY8bmO+Ni61qmxo/qr2sFelqp1F7E6k6XkKWa6C/WpQPf0MuE7IQx8XSN # RhjVjaap2x2meMEyTAgKAdrBMRlGDeXLv7A6+JvqgWm+fN2zC1gvWUXEdz8mI5lN # DoVnjslswUkLCn4QBfEsdQuRhiHkhypC5+iUwnk38VcWpWnSnycXJf4DsbYnKIRq # VQwIxjTe+XLanmHiHTVzCos8I6tT0vfi3Co/SQR123kmH3TvtlvFsXBsRVxgD7Rs # KREEilV9aLebiI60iQ+NrSaF4aG49/ZAaw7s1aW9pUq2UAsscoUj4R04IbG/aJOP # XtWGsW+ki6ZDoMbuuT1cyKuLX2S7SmQvqOVXqrkWpYQ1QFOr4Zffsv89gT94qvTz # Snv9yXGKK1Q7nUmYj2JiBeCOqEDZjgMFKoiZ83sKRGEyjXuD/U8D3FhCEWkRPnjw # A9gnarLSiqRFGQcZPv24FXIw # =fZrU # -----END PGP SIGNATURE----- # gpg: Signature made Fri Aug 14 01:46:41 2026 IST # gpg: using RSA key 208DD36ED5BB3745A16743A4C7C6FBB5B91C1155 # gpg: Can't check signature: No public key
2 parents d9ead43 + 813176c commit b4fdc7e

441 files changed

Lines changed: 62096 additions & 13867 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

go.mod

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ require (
1212
github.com/Masterminds/sprig/v3 v3.3.0
1313
github.com/Masterminds/squirrel v1.5.4
1414
github.com/Masterminds/vcs v1.13.3
15+
github.com/ProtonMail/go-crypto v1.4.1
1516
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
16-
github.com/containerd/containerd v1.7.32
17-
github.com/cyphar/filepath-securejoin v0.6.1
17+
github.com/cyphar/filepath-securejoin v0.7.0
1818
github.com/distribution/distribution/v3 v3.1.1
1919
github.com/evanphx/json-patch v5.9.11+incompatible
2020
github.com/foxcpp/go-mockdns v1.2.0
@@ -35,9 +35,9 @@ require (
3535
github.com/spf13/cobra v1.10.2
3636
github.com/spf13/pflag v1.0.10
3737
github.com/stretchr/testify v1.11.1
38-
golang.org/x/crypto v0.53.0
39-
golang.org/x/term v0.44.0
40-
golang.org/x/text v0.38.0
38+
golang.org/x/crypto v0.54.0
39+
golang.org/x/term v0.45.0
40+
golang.org/x/text v0.40.0
4141
gopkg.in/yaml.v3 v3.0.1
4242
k8s.io/api v0.36.2
4343
k8s.io/apiextensions-apiserver v0.36.2
@@ -62,9 +62,7 @@ require (
6262
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
6363
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6464
github.com/chai2010/gettext-go v1.0.2 // indirect
65-
github.com/containerd/errdefs v0.3.0 // indirect
66-
github.com/containerd/log v0.1.0 // indirect
67-
github.com/containerd/platforms v0.2.1 // indirect
65+
github.com/cloudflare/circl v1.6.3 // indirect
6866
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
6967
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
7068
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
@@ -134,7 +132,7 @@ require (
134132
go.opentelemetry.io/contrib/bridges/prometheus v0.67.0 // indirect
135133
go.opentelemetry.io/contrib/exporters/autoexport v0.67.0 // indirect
136134
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 // indirect
137-
go.opentelemetry.io/otel v1.43.0 // indirect
135+
go.opentelemetry.io/otel v1.44.0 // indirect
138136
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0 // indirect
139137
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.19.0 // indirect
140138
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0 // indirect
@@ -147,24 +145,24 @@ require (
147145
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.43.0 // indirect
148146
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.43.0 // indirect
149147
go.opentelemetry.io/otel/log v0.19.0 // indirect
150-
go.opentelemetry.io/otel/metric v1.43.0 // indirect
148+
go.opentelemetry.io/otel/metric v1.44.0 // indirect
151149
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
152150
go.opentelemetry.io/otel/sdk/log v0.19.0 // indirect
153151
go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect
154-
go.opentelemetry.io/otel/trace v1.43.0 // indirect
152+
go.opentelemetry.io/otel/trace v1.44.0 // indirect
155153
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
156154
go.yaml.in/yaml/v2 v2.4.4 // indirect
157155
go.yaml.in/yaml/v3 v3.0.4 // indirect
158-
golang.org/x/mod v0.36.0 // indirect
159-
golang.org/x/net v0.55.0 // indirect
160-
golang.org/x/oauth2 v0.35.0 // indirect
161-
golang.org/x/sync v0.21.0 // indirect
162-
golang.org/x/sys v0.46.0 // indirect
156+
golang.org/x/mod v0.37.0 // indirect
157+
golang.org/x/net v0.56.0 // indirect
158+
golang.org/x/oauth2 v0.36.0 // indirect
159+
golang.org/x/sync v0.22.0 // indirect
160+
golang.org/x/sys v0.47.0 // indirect
163161
golang.org/x/time v0.14.0 // indirect
164-
golang.org/x/tools v0.45.0 // indirect
165-
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
166-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d // indirect
167-
google.golang.org/grpc v1.80.0 // indirect
162+
golang.org/x/tools v0.47.0 // indirect
163+
google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 // indirect
164+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect
165+
google.golang.org/grpc v1.82.1 // indirect
168166
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
169167
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
170168
gopkg.in/inf.v0 v0.9.1 // indirect

go.sum

Lines changed: 36 additions & 40 deletions
Large diffs are not rendered by default.

pkg/engine/files.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (f files) AsSecrets() string {
154154
// {{ range .Files.Lines "foo/bar.html" }}
155155
// {{ . }}{{ end }}
156156
func (f files) Lines(path string) []string {
157-
if f == nil || f[path] == nil {
157+
if f == nil || len(f[path]) == 0 {
158158
return []string{}
159159
}
160160
s := string(f[path])

pkg/engine/files_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ var cases = []struct {
3030
{"story/author.txt", "Joseph Conrad"},
3131
{"multiline/test.txt", "bar\nfoo\n"},
3232
{"multiline/test_with_blank_lines.txt", "bar\nfoo\n\n\n"},
33+
{"empty/empty.txt", ""},
34+
{"empty/newline_only.txt", "\n"},
3335
}
3436

3537
func getTestFiles() files {
@@ -109,3 +111,31 @@ func TestBlankLines(t *testing.T) {
109111
as.Equal("bar", out[0])
110112
as.Equal("", out[3])
111113
}
114+
115+
func TestLinesEmptyFile(t *testing.T) {
116+
as := assert.New(t)
117+
118+
f := getTestFiles()
119+
120+
out := f.Lines("empty/empty.txt")
121+
as.Empty(out)
122+
}
123+
124+
func TestLinesNewlineOnlyFile(t *testing.T) {
125+
as := assert.New(t)
126+
127+
f := getTestFiles()
128+
129+
out := f.Lines("empty/newline_only.txt")
130+
as.Len(out, 1)
131+
as.Empty(out[0])
132+
}
133+
134+
func TestLinesMissingFile(t *testing.T) {
135+
as := assert.New(t)
136+
137+
f := getTestFiles()
138+
139+
out := f.Lines("nonexistent.txt")
140+
as.Empty(out)
141+
}

pkg/provenance/sign.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import (
2424
"path/filepath"
2525
"strings"
2626

27+
"github.com/ProtonMail/go-crypto/openpgp"
28+
"github.com/ProtonMail/go-crypto/openpgp/clearsign"
29+
"github.com/ProtonMail/go-crypto/openpgp/packet"
2730
"github.com/pkg/errors"
28-
"golang.org/x/crypto/openpgp" //nolint
29-
"golang.org/x/crypto/openpgp/clearsign" //nolint
30-
"golang.org/x/crypto/openpgp/packet" //nolint
3131
"sigs.k8s.io/yaml"
3232

3333
hapi "helm.sh/helm/v3/pkg/chart"
@@ -314,8 +314,9 @@ func (s *Signatory) decodeSignature(filename string) (*clearsign.Block, error) {
314314
func (s *Signatory) verifySignature(block *clearsign.Block) (*openpgp.Entity, error) {
315315
return openpgp.CheckDetachedSignature(
316316
s.KeyRing,
317-
bytes.NewBuffer(block.Bytes),
317+
bytes.NewReader(block.Bytes),
318318
block.ArmoredSignature.Body,
319+
&defaultPGPConfig,
319320
)
320321
}
321322

pkg/provenance/sign_test.go

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import (
2424
"strings"
2525
"testing"
2626

27-
pgperrors "golang.org/x/crypto/openpgp/errors" //nolint
27+
pgperrors "github.com/ProtonMail/go-crypto/openpgp/errors"
28+
"github.com/ProtonMail/go-crypto/openpgp/packet"
2829
)
2930

3031
const (
@@ -56,6 +57,9 @@ const (
5657
// testTamperedSigBlock is a tampered copy of msgblock.yaml.asc
5758
testTamperedSigBlock = "testdata/msgblock.yaml.tampered"
5859

60+
// testMixedKeyring points to a keyring containing RSA and ed25519 keys.
61+
testMixedKeyring = "testdata/helm-mixed-keyring.pub"
62+
5963
// testSumfile points to a SHA256 sum generated by an external tool.
6064
// We always want to validate against an external tool's representation to
6165
// verify that we haven't done something stupid. This file was generated
@@ -232,6 +236,56 @@ func TestClearSign(t *testing.T) {
232236
}
233237
}
234238

239+
func TestMixedKeyringRSASigningAndVerification(t *testing.T) {
240+
signer, err := NewFromFiles(testKeyfile, testMixedKeyring)
241+
if err != nil {
242+
t.Fatal(err)
243+
}
244+
245+
if signer.Entity == nil {
246+
t.Fatal("expected signer entity to be loaded")
247+
}
248+
249+
if signer.Entity.PrivateKey == nil {
250+
t.Fatal("expected signer private key to be loaded")
251+
}
252+
253+
if signer.Entity.PrivateKey.PubKeyAlgo != packet.PubKeyAlgoRSA {
254+
t.Fatalf("expected RSA key but got %v", signer.Entity.PrivateKey.PubKeyAlgo)
255+
}
256+
257+
sig, err := signer.ClearSign(testChartfile)
258+
if err != nil {
259+
t.Fatalf("failed to sign chart: %v", err)
260+
}
261+
262+
sigpath := filepath.Join(t.TempDir(), "hashtest-1.2.3.tgz.prov")
263+
if err := os.WriteFile(sigpath, []byte(sig), 0o644); err != nil {
264+
t.Fatal(err)
265+
}
266+
267+
verification, err := signer.Verify(testChartfile, sigpath)
268+
if err != nil {
269+
t.Fatalf("failed to verify chart signature: %v", err)
270+
}
271+
272+
if verification.SignedBy == nil {
273+
t.Fatal("expected verification to include signer")
274+
}
275+
276+
if verification.SignedBy.PrimaryKey == nil {
277+
t.Fatal("expected verification to include signer primary key")
278+
}
279+
280+
if verification.SignedBy.PrimaryKey.PubKeyAlgo != packet.PubKeyAlgoRSA {
281+
t.Fatalf("expected verification to report RSA key but got %v", verification.SignedBy.PrimaryKey.PubKeyAlgo)
282+
}
283+
284+
if _, ok := verification.SignedBy.Identities[testKeyName]; !ok {
285+
t.Fatalf("expected verification to be signed by %q", testKeyName)
286+
}
287+
}
288+
235289
// failSigner always fails to sign and returns an error
236290
type failSigner struct{}
237291

1.46 KB
Binary file not shown.

pkg/registry/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"sync"
3232

3333
"github.com/Masterminds/semver/v3"
34-
"github.com/containerd/containerd/remotes"
3534
"github.com/opencontainers/image-spec/specs-go"
3635
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
3736
"github.com/pkg/errors"
@@ -56,7 +55,7 @@ storing semantic versions, Helm adopts the convention of changing plus (+) to
5655
an underscore (_) in chart version tags when pushing to a registry and back to
5756
a plus (+) when pulling from a registry.`
5857

59-
var errDeprecatedRemote = errors.New("providing github.com/containerd/containerd/remotes.Resolver via ClientOptResolver is no longer suported")
58+
var errDeprecatedRemote = errors.New("providing github.com/containerd/containerd/remotes.Resolver via ClientOptResolver is no longer supported")
6059

6160
type (
6261
// RemoteClient shadows the ORAS remote.Client interface
@@ -237,7 +236,7 @@ func ClientOptPlainHTTP() ClientOption {
237236
}
238237
}
239238

240-
func ClientOptResolver(_ remotes.Resolver) ClientOption {
239+
func ClientOptResolver(_ any) ClientOption {
241240
return func(c *Client) {
242241
c.err = errDeprecatedRemote
243242
}

pkg/registry/client_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ import (
2121
"io"
2222
"testing"
2323

24-
"github.com/containerd/containerd/remotes"
2524
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
2625
"github.com/stretchr/testify/assert"
2726
"github.com/stretchr/testify/require"
2827
"oras.land/oras-go/v2/content/memory"
2928
)
3029

3130
func TestNewClientResolverNotSupported(t *testing.T) {
32-
var r remotes.Resolver
33-
34-
client, err := NewClient(ClientOptResolver(r))
31+
client, err := NewClient(ClientOptResolver(nil))
3532
require.Equal(t, err, errDeprecatedRemote)
3633
assert.Nil(t, client)
3734
}

vendor/github.com/ProtonMail/go-crypto/AUTHORS

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)