Skip to content

Commit

Permalink
fix(deps): update module helm.sh/helm/v3 to v3.13.2
Browse files Browse the repository at this point in the history
Signed-off-by: renovate[bot] <[email protected]>
  • Loading branch information
renovate[bot] authored and tklauser committed Nov 10, 2023
1 parent 55a8d60 commit 35f6a82
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 48 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
golang.org/x/mod v0.14.0
google.golang.org/grpc v1.59.0
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
helm.sh/helm/v3 v3.13.1
helm.sh/helm/v3 v3.13.2
k8s.io/api v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/cli-runtime v0.28.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=
helm.sh/helm/v3 v3.13.1 h1:DG+XLGzBJeZvMLlMbm6bPDLV1dGaVW9eZsDoUd1/LM0=
helm.sh/helm/v3 v3.13.1/go.mod h1:TdQRMiq46CSWcc68Hb0uVhvAWusaN90YwAV54cz6JzU=
helm.sh/helm/v3 v3.13.2 h1:IcO9NgmmpetJODLZhR3f3q+6zzyXVKlRizKFwbi7K8w=
helm.sh/helm/v3 v3.13.2/go.mod h1:GIHDwZggaTGbedevTlrQ6DB++LBN6yuQdeGj0HNaDx0=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
1 change: 1 addition & 0 deletions vendor/helm.sh/helm/v3/pkg/action/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func (r *Rollback) prepareRollback(name string) (*release.Release, *release.Rele
Description: fmt.Sprintf("Rollback to %d", previousVersion),
},
Version: currentRelease.Version + 1,
Labels: previousRelease.Labels,
Manifest: previousRelease.Manifest,
Hooks: previousRelease.Hooks,
}
Expand Down
12 changes: 2 additions & 10 deletions vendor/helm.sh/helm/v3/pkg/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,8 @@ func NewClient(options ...ClientOption) (*Client, error) {
return resolver, nil
}
}

headers := http.Header{}
headers.Set("User-Agent", version.GetUserAgent())
dockerClient, ok := client.authorizer.(*dockerauth.Client)
if ok {
username, password, err := dockerClient.Credential(ref.Registry)
if err != nil {
return nil, fmt.Errorf("unable to retrieve credentials: %w", err)
}
authHeader(username, password, &headers)
}

opts := []auth.ResolverOption{auth.WithResolverHeaders(headers)}
if client.httpClient != nil {
opts = append(opts, auth.WithResolverClient(client.httpClient))
Expand Down Expand Up @@ -139,6 +129,7 @@ func NewClient(options ...ClientOption) (*Client, error) {
if !ok {
return registryauth.EmptyCredential, errors.New("unable to obtain docker client")
}

username, password, err := dockerClient.Credential(reg)
if err != nil {
return registryauth.EmptyCredential, errors.New("unable to retrieve credentials")
Expand Down Expand Up @@ -602,6 +593,7 @@ func (c *Client) Push(data []byte, ref string, options ...PushOption) (*PushResu
if err := memoryStore.StoreManifest(parsedRef.String(), manifest, manifestData); err != nil {
return nil, err
}

remotesResolver, err := c.resolver(parsedRef)
if err != nil {
return nil, err
Expand Down
30 changes: 0 additions & 30 deletions vendor/helm.sh/helm/v3/pkg/registry/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package registry // import "helm.sh/helm/v3/pkg/registry"
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -246,32 +245,3 @@ func addToMap(inputMap map[string]string, newKey string, newValue string) map[st
return inputMap

}

// See 2 (end of page 4) https://www.ietf.org/rfc/rfc2617.txt
// "To receive authorization, the client sends the userid and password,
// separated by a single colon (":") character, within a base64
// encoded string in the credentials."
// It is not meant to be urlencoded.
func basicAuth(username, password string) string {
auth := username + ":" + password
return base64.StdEncoding.EncodeToString([]byte(auth))
}

// authHeader generates an HTTP authorization header based on the provided
// username and password and sets it in the provided HTTP headers pointer.
//
// If both username and password are empty, no header is set.
// If only the password is provided, a "Bearer" token is created and set in
// the Authorization header.
// If both username and password are provided, a "Basic" authentication token
// is created using the basicAuth function, and set in the Authorization header.
func authHeader(username, password string, headers *http.Header) {
if username == "" && password == "" {
return
}
if username == "" {
headers.Set("Authorization", fmt.Sprintf("Bearer %s", password))
return
}
headers.Set("Authorization", fmt.Sprintf("Basic %s", basicAuth(username, password)))
}
4 changes: 2 additions & 2 deletions vendor/helm.sh/helm/v3/pkg/storage/driver/cfgmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (cfgmaps *ConfigMaps) List(filter func(*rspb.Release) bool) ([]*rspb.Releas
continue
}

rls.Labels = filterSystemLabels(item.ObjectMeta.Labels)
rls.Labels = item.ObjectMeta.Labels

if filter(rls) {
results = append(results, rls)
Expand Down Expand Up @@ -146,7 +146,7 @@ func (cfgmaps *ConfigMaps) Query(labels map[string]string) ([]*rspb.Release, err
cfgmaps.Log("query: failed to decode release: %s", err)
continue
}
rls.Labels = filterSystemLabels(item.ObjectMeta.Labels)
rls.Labels = item.ObjectMeta.Labels
results = append(results, rls)
}
return results, nil
Expand Down
4 changes: 2 additions & 2 deletions vendor/helm.sh/helm/v3/pkg/storage/driver/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (secrets *Secrets) List(filter func(*rspb.Release) bool) ([]*rspb.Release,
continue
}

rls.Labels = filterSystemLabels(item.ObjectMeta.Labels)
rls.Labels = item.ObjectMeta.Labels

if filter(rls) {
results = append(results, rls)
Expand Down Expand Up @@ -137,7 +137,7 @@ func (secrets *Secrets) Query(labels map[string]string) ([]*rspb.Release, error)
secrets.Log("query: failed to decode release: %s", err)
continue
}
rls.Labels = filterSystemLabels(item.ObjectMeta.Labels)
rls.Labels = item.ObjectMeta.Labels
results = append(results, rls)
}
return results, nil
Expand Down
14 changes: 14 additions & 0 deletions vendor/helm.sh/helm/v3/pkg/storage/driver/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package driver // import "helm.sh/helm/v3/pkg/storage/driver"
import (
"fmt"
"sort"
"strconv"
"time"

"github.com/jmoiron/sqlx"
Expand Down Expand Up @@ -368,6 +369,9 @@ func (s *SQL) List(filter func(*rspb.Release) bool) ([]*rspb.Release, error) {
s.Log("failed to get release %s/%s custom labels: %v", record.Namespace, record.Key, err)
return nil, err
}
for k, v := range getReleaseSystemLabels(release) {
release.Labels[k] = v
}

if filter(release) {
releases = append(releases, release)
Expand Down Expand Up @@ -681,3 +685,13 @@ func (s *SQL) getReleaseCustomLabels(key string, namespace string) (map[string]s

return filterSystemLabels(labelsMap), nil
}

// Rebuild system labels from release object
func getReleaseSystemLabels(rls *rspb.Release) map[string]string {
return map[string]string{
"name": rls.Name,
"owner": sqlReleaseDefaultOwner,
"status": rls.Info.Status.String(),
"version": strconv.Itoa(rls.Version),
}
}
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ gopkg.in/yaml.v2
# gopkg.in/yaml.v3 v3.0.1
## explicit
gopkg.in/yaml.v3
# helm.sh/helm/v3 v3.13.1
# helm.sh/helm/v3 v3.13.2
## explicit; go 1.19
helm.sh/helm/v3/internal/fileutil
helm.sh/helm/v3/internal/ignore
Expand Down

0 comments on commit 35f6a82

Please sign in to comment.