diff --git a/tests/go.mod b/tests/go.mod index a2b5e56df..489874750 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -4,7 +4,7 @@ go 1.22.2 require ( github.com/gruntwork-io/terratest v0.47.0 - github.com/mittwald/go-helm-client v0.12.10 + github.com/mittwald/go-helm-client v0.12.12 github.com/onsi/ginkgo/v2 v2.19.1 github.com/onsi/gomega v1.34.1 github.com/stretchr/testify v1.9.0 diff --git a/tests/go.sum b/tests/go.sum index 8d576641e..025a9cbf2 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -289,8 +289,8 @@ github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mittwald/go-helm-client v0.12.10 h1:NvDXzBM0enPtrAHirZQ0D9Zx80yp2cGWcR19i0CleZY= -github.com/mittwald/go-helm-client v0.12.10/go.mod h1:HA3eMOaUhqa4EXUfj94f6L0v4aUEKHuVV977hVl1KWU= +github.com/mittwald/go-helm-client v0.12.12 h1:56eYOEOLguP34c3MIZi3JdkpdgGO1Tjp3Cb6NmmJNlU= +github.com/mittwald/go-helm-client v0.12.12/go.mod h1:4Fb6Ryix9NRJJyYMg1RtVNx4EJz1incsyGFn+Yno2U4= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= diff --git a/tests/vendor/github.com/mittwald/go-helm-client/client.go b/tests/vendor/github.com/mittwald/go-helm-client/client.go index 020021b15..ffb1b1ba6 100644 --- a/tests/vendor/github.com/mittwald/go-helm-client/client.go +++ b/tests/vendor/github.com/mittwald/go-helm-client/client.go @@ -8,10 +8,9 @@ import ( "log" "os" "reflect" + "slices" "strings" - "golang.org/x/exp/slices" - "k8s.io/apimachinery/pkg/api/errors" "github.com/spf13/pflag" @@ -943,6 +942,7 @@ func mergeUpgradeOptions(chartSpec *ChartSpec, upgradeOptions *action.Upgrade) { upgradeOptions.Force = chartSpec.Force upgradeOptions.ResetValues = chartSpec.ResetValues upgradeOptions.ReuseValues = chartSpec.ReuseValues + upgradeOptions.ResetThenReuseValues = chartSpec.ResetThenReuseValues upgradeOptions.Recreate = chartSpec.Recreate upgradeOptions.MaxHistory = chartSpec.MaxHistory upgradeOptions.Atomic = chartSpec.Atomic diff --git a/tests/vendor/github.com/mittwald/go-helm-client/spec.go b/tests/vendor/github.com/mittwald/go-helm-client/spec.go index ffb9ee719..acbd438c3 100644 --- a/tests/vendor/github.com/mittwald/go-helm-client/spec.go +++ b/tests/vendor/github.com/mittwald/go-helm-client/spec.go @@ -1,7 +1,8 @@ package helmclient import ( - "github.com/pkg/errors" + "fmt" + "helm.sh/helm/v3/pkg/getter" "sigs.k8s.io/yaml" @@ -15,12 +16,12 @@ func (spec *ChartSpec) GetValuesMap(p getter.Providers) (map[string]interface{}, err := yaml.Unmarshal([]byte(spec.ValuesYaml), &valuesYaml) if err != nil { - return nil, errors.Wrap(err, "Failed to Parse ValuesYaml") + return nil, fmt.Errorf("failed to parse ValuesYaml: %w", err) } valuesOptions, err := spec.ValuesOptions.MergeValues(p) if err != nil { - return nil, errors.Wrap(err, "Failed to Parse ValuesOptions") + return nil, fmt.Errorf("failed to parse ValuesOptions: %w", err) } return values.MergeMaps(valuesYaml, valuesOptions), nil diff --git a/tests/vendor/github.com/mittwald/go-helm-client/types.go b/tests/vendor/github.com/mittwald/go-helm-client/types.go index b5999ffa4..2256b004d 100644 --- a/tests/vendor/github.com/mittwald/go-helm-client/types.go +++ b/tests/vendor/github.com/mittwald/go-helm-client/types.go @@ -176,6 +176,9 @@ type ChartSpec struct { // ReuseValues indicates whether to reuse the values.yaml file during installation. // +optional ReuseValues bool `json:"reuseValues,omitempty"` + // ResetThenReuseValues will reset the values to the chart's built-ins then merge with user's last supplied values. + // +optional + ResetThenReuseValues bool // Recreate indicates whether to recreate the release if it already exists. // +optional Recreate bool `json:"recreate,omitempty"` diff --git a/tests/vendor/github.com/mittwald/go-helm-client/values/options.go b/tests/vendor/github.com/mittwald/go-helm-client/values/options.go index 0fcc96099..285b75cc4 100644 --- a/tests/vendor/github.com/mittwald/go-helm-client/values/options.go +++ b/tests/vendor/github.com/mittwald/go-helm-client/values/options.go @@ -23,12 +23,12 @@ Changes: package values import ( + "fmt" "io" "net/url" "os" "strings" - "github.com/pkg/errors" "sigs.k8s.io/yaml" "helm.sh/helm/v3/pkg/getter" @@ -65,7 +65,7 @@ func (opts *Options) MergeValues(p getter.Providers) (map[string]interface{}, er } if err := yaml.Unmarshal(bytes, ¤tMap); err != nil { - return nil, errors.Wrapf(err, "failed to parse %s", filePath) + return nil, fmt.Errorf("failed to parse %s: %w", filePath, err) } // Merge with the previous map base = MergeMaps(base, currentMap) @@ -74,21 +74,21 @@ func (opts *Options) MergeValues(p getter.Providers) (map[string]interface{}, er // User specified a value via --set-json for _, value := range opts.JSONValues { if err := strvals.ParseJSON(value, base); err != nil { - return nil, errors.Errorf("failed parsing --set-json data %s", value) + return nil, fmt.Errorf("failed parsing --set-json data %s: %w", value, err) } } // User specified a value via --set for _, value := range opts.Values { if err := strvals.ParseInto(value, base); err != nil { - return nil, errors.Wrap(err, "failed parsing --set data") + return nil, fmt.Errorf("failed parsing --set data: %w", err) } } // User specified a value via --set-string for _, value := range opts.StringValues { if err := strvals.ParseIntoString(value, base); err != nil { - return nil, errors.Wrap(err, "failed parsing --set-string data") + return nil, fmt.Errorf("failed parsing --set-string data: %w", err) } } @@ -102,7 +102,7 @@ func (opts *Options) MergeValues(p getter.Providers) (map[string]interface{}, er return string(bytes), err } if err := strvals.ParseIntoFile(value, base, reader); err != nil { - return nil, errors.Wrap(err, "failed parsing --set-file data") + return nil, fmt.Errorf("failed parsing --set-file data: %w", err) } } diff --git a/tests/vendor/modules.txt b/tests/vendor/modules.txt index 625cf8fb1..0bedb1480 100644 --- a/tests/vendor/modules.txt +++ b/tests/vendor/modules.txt @@ -438,7 +438,7 @@ github.com/mitchellh/hashstructure # github.com/mitchellh/reflectwalk v1.0.2 ## explicit github.com/mitchellh/reflectwalk -# github.com/mittwald/go-helm-client v0.12.10 +# github.com/mittwald/go-helm-client v0.12.12 ## explicit; go 1.22.0 github.com/mittwald/go-helm-client github.com/mittwald/go-helm-client/values