From 16ca1fa2da5c3cf6d6e40c11600ad1747b242598 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 23 Nov 2021 23:44:48 -0800 Subject: [PATCH] Fix SiteInfo publishing (#1323) (#1336) /cherry-pick Signed-off-by: 1gtm <1gtm@appscode.com> Signed-off-by: Tamal Saha Co-authored-by: lgtm <1gtm@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++++---- vendor/go.bytebuilders.dev/license-verifier/Makefile | 4 ++-- .../go.bytebuilders.dev/license-verifier/info/lib.go | 12 ++++++++++++ .../license-verifier/kubernetes/go.mod | 2 +- vendor/go.bytebuilders.dev/license-verifier/lib.go | 7 ++----- vendor/modules.txt | 4 ++-- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 90c1d1638..a447c8c71 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.1.3 - go.bytebuilders.dev/license-verifier/kubernetes v0.9.5 + go.bytebuilders.dev/license-verifier/kubernetes v0.9.7 gomodules.xyz/flags v0.1.3 gomodules.xyz/go-sh v0.1.0 gomodules.xyz/logs v0.0.6 diff --git a/go.sum b/go.sum index 1cc9d4b0c..c66abfd30 100644 --- a/go.sum +++ b/go.sum @@ -712,10 +712,10 @@ github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPS github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= go.bytebuilders.dev/audit v0.0.10/go.mod h1:jhNyXHoeVHijC4tM7EYpcB9RqkwnI27IoRN3k0ivick= go.bytebuilders.dev/license-verifier v0.9.3/go.mod h1:GpIW0o8O0wpiBVt7IIz4z7bcPuG8nza8/bCDkaupDn8= -go.bytebuilders.dev/license-verifier v0.9.5 h1:XUbFH3LzHSpQFtVS/MiT5RN0gr/KNNBvnOm78KYoAEQ= -go.bytebuilders.dev/license-verifier v0.9.5/go.mod h1:GpIW0o8O0wpiBVt7IIz4z7bcPuG8nza8/bCDkaupDn8= -go.bytebuilders.dev/license-verifier/kubernetes v0.9.5 h1:KWzmh4qZ+3cR8LpBuUfufb2goK5NuULyE0uKYgt3D50= -go.bytebuilders.dev/license-verifier/kubernetes v0.9.5/go.mod h1:mg5pZDweHlpTTw57kOdLj4bU107hHVP/1xTKKZ1eUNc= +go.bytebuilders.dev/license-verifier v0.9.7 h1:m7Z3cuVJYUUctCfTK6qT0IKtPVZurxq1b1bKzWjqwsE= +go.bytebuilders.dev/license-verifier v0.9.7/go.mod h1:GpIW0o8O0wpiBVt7IIz4z7bcPuG8nza8/bCDkaupDn8= +go.bytebuilders.dev/license-verifier/kubernetes v0.9.7 h1:TN9N9FmmxrPTQoAPJsQnHRgY00liNZgiTUyZ2QNtqyg= +go.bytebuilders.dev/license-verifier/kubernetes v0.9.7/go.mod h1:hsNtdOrSnm5v8dwTgbKLVADNTgD+b6eaZHXiJZXoPcE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= diff --git a/vendor/go.bytebuilders.dev/license-verifier/Makefile b/vendor/go.bytebuilders.dev/license-verifier/Makefile index 083435503..7ae2a8b40 100644 --- a/vendor/go.bytebuilders.dev/license-verifier/Makefile +++ b/vendor/go.bytebuilders.dev/license-verifier/Makefile @@ -61,8 +61,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64 OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= gcr.io/distroless/static-debian10 -BASEIMAGE_DBG ?= debian:buster +BASEIMAGE_PROD ?= gcr.io/distroless/static-debian11 +BASEIMAGE_DBG ?= debian:bullseye GO_VERSION ?= 1.17 BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION) diff --git a/vendor/go.bytebuilders.dev/license-verifier/info/lib.go b/vendor/go.bytebuilders.dev/license-verifier/info/lib.go index f2b760cfe..2cf482c12 100644 --- a/vendor/go.bytebuilders.dev/license-verifier/info/lib.go +++ b/vendor/go.bytebuilders.dev/license-verifier/info/lib.go @@ -20,6 +20,8 @@ import ( "net/url" "path" "strconv" + "strings" + "unicode" ) var ( @@ -37,6 +39,16 @@ var ( registrationAPIPath = "api/v1/register" ) +func Features() []string { + return ParseFeatures(ProductName) +} + +func ParseFeatures(features string) []string { + return strings.FieldsFunc(features, func(r rune) bool { + return unicode.IsSpace(r) || r == ',' || r == ';' + }) +} + func SkipLicenseVerification() bool { v, _ := strconv.ParseBool(EnforceLicense) return !v diff --git a/vendor/go.bytebuilders.dev/license-verifier/kubernetes/go.mod b/vendor/go.bytebuilders.dev/license-verifier/kubernetes/go.mod index f31e9296e..5d6bfd300 100644 --- a/vendor/go.bytebuilders.dev/license-verifier/kubernetes/go.mod +++ b/vendor/go.bytebuilders.dev/license-verifier/kubernetes/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/gogo/protobuf v1.3.2 - go.bytebuilders.dev/license-verifier v0.9.5 + go.bytebuilders.dev/license-verifier v0.9.7 k8s.io/api v0.21.1 k8s.io/apimachinery v0.21.1 k8s.io/apiserver v0.21.1 diff --git a/vendor/go.bytebuilders.dev/license-verifier/lib.go b/vendor/go.bytebuilders.dev/license-verifier/lib.go index 8e3b4f712..64e132af4 100644 --- a/vendor/go.bytebuilders.dev/license-verifier/lib.go +++ b/vendor/go.bytebuilders.dev/license-verifier/lib.go @@ -21,9 +21,9 @@ import ( "encoding/pem" "fmt" "strings" - "unicode" "go.bytebuilders.dev/license-verifier/apis/licenses/v1alpha1" + "go.bytebuilders.dev/license-verifier/info" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -165,10 +165,7 @@ func VerifyLicense(opts *Options) (v1alpha1.License, error) { license.Reason = e2.Error() return license, e2 } - features := strings.FieldsFunc(opts.Features, func(r rune) bool { - return unicode.IsSpace(r) || r == ',' || r == ';' - }) - if !sets.NewString(cert.Subject.Organization...).HasAny(features...) { + if !sets.NewString(cert.Subject.Organization...).HasAny(info.ParseFeatures(opts.Features)...) { e2 := fmt.Errorf("license was not issued for %s", opts.Features) license.Status = v1alpha1.LicenseExpired license.Reason = e2.Error() diff --git a/vendor/modules.txt b/vendor/modules.txt index 3714d932c..f62aaf821 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -123,12 +123,12 @@ github.com/yudai/gojsondiff github.com/yudai/gojsondiff/formatter # github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 github.com/yudai/golcs -# go.bytebuilders.dev/license-verifier v0.9.5 +# go.bytebuilders.dev/license-verifier v0.9.7 go.bytebuilders.dev/license-verifier go.bytebuilders.dev/license-verifier/apis/licenses go.bytebuilders.dev/license-verifier/apis/licenses/v1alpha1 go.bytebuilders.dev/license-verifier/info -# go.bytebuilders.dev/license-verifier/kubernetes v0.9.5 +# go.bytebuilders.dev/license-verifier/kubernetes v0.9.7 ## explicit go.bytebuilders.dev/license-verifier/kubernetes # golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b