From ca8e9c7d59a9f25938837ba1cfddcfa58312a270 Mon Sep 17 00:00:00 2001 From: "Jose R. Gonzalez" Date: Tue, 11 Jul 2023 14:15:27 -0500 Subject: [PATCH] Update sprig to v3 to resolve semver constraint validity issues Signed-off-by: Jose R. Gonzalez --- go.mod | 3 +-- go.sum | 2 -- internal/chartverifier/checks/checks.go | 2 +- internal/chartverifier/checks/checks_test.go | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 334e2559..2d0406de 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/Masterminds/semver v1.5.0 - github.com/Masterminds/sprig v2.22.0+incompatible + github.com/Masterminds/sprig/v3 v3.2.3 github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.0 github.com/helm/chart-testing/v3 v3.8.0 @@ -31,7 +31,6 @@ require ( github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect - github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Masterminds/squirrel v1.5.3 // indirect github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/go.sum b/go.sum index 14d76af0..ebc1a805 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,6 @@ github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= diff --git a/internal/chartverifier/checks/checks.go b/internal/chartverifier/checks/checks.go index 49fc9e3b..8e1cc303 100644 --- a/internal/chartverifier/checks/checks.go +++ b/internal/chartverifier/checks/checks.go @@ -26,7 +26,7 @@ import ( "path" "strings" - "github.com/Masterminds/sprig" + "github.com/Masterminds/sprig/v3" "golang.org/x/mod/semver" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/lint" diff --git a/internal/chartverifier/checks/checks_test.go b/internal/chartverifier/checks/checks_test.go index 4d013a38..ead9bbed 100644 --- a/internal/chartverifier/checks/checks_test.go +++ b/internal/chartverifier/checks/checks_test.go @@ -530,7 +530,7 @@ func TestSemVers(t *testing.T) { {kubeVersion: ">= 1.14.0-0", OCPRange: ">=4.2"}, {kubeVersion: "1.16 - 1.21", OCPRange: "4.3 - 4.8"}, {kubeVersion: "*", OCPRange: ">=4.1"}, - {kubeVersion: ">=1.16.0 <1.22.0", OCPRange: "Error converting kubeVersion to an OCP range : improper constraint: >=1.16.0 <1.22.0"}, + {kubeVersion: ">= 1.23.0 < 1.26.3", OCPRange: "4.10 - 4.13"}, } for _, test := range testCases {