diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f41436d6..a6f61835c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,10 @@ jobs: name: Build runs-on: ubuntu-20.04 steps: - - name: Set up Go 1.21 + - name: Set up Go 1.22 uses: actions/setup-go@v1 with: - go-version: '1.21' + go-version: '1.22' id: go - uses: actions/checkout@v1 diff --git a/Makefile b/Makefile index 5d3514564..982fd58b3 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ TAG := $(VERSION)_$(OS)_$(ARCH) TAG_PROD := $(TAG) TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH) -GO_VERSION ?= 1.21 +GO_VERSION ?= 1.22 BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION) OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) diff --git a/go.mod b/go.mod index 8be488499..b60d29ab7 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.2 require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.8.0 - go.bytebuilders.dev/license-verifier/kubernetes v0.13.4 + go.bytebuilders.dev/license-verifier/kubernetes v0.14.0 gomodules.xyz/flags v0.1.3 gomodules.xyz/go-sh v0.1.0 gomodules.xyz/logs v0.0.7 @@ -26,7 +26,7 @@ require ( require ( github.com/Masterminds/semver/v3 v3.2.1 // indirect - github.com/PuerkitoBio/purell v1.2.0 // indirect + github.com/PuerkitoBio/purell v1.2.1 // indirect github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -70,8 +70,8 @@ require ( github.com/yudai/gojsondiff v1.0.0 // indirect github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect - go.bytebuilders.dev/license-proxyserver v0.0.7-0.20231225202028-31122ab82502 // indirect - go.bytebuilders.dev/license-verifier v0.13.4 // indirect + go.bytebuilders.dev/license-proxyserver v0.0.9 // indirect + go.bytebuilders.dev/license-verifier v0.14.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect @@ -87,7 +87,6 @@ require ( google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.29.2 // indirect diff --git a/go.sum b/go.sum index d41b4dc10..0481eba23 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.2.0 h1:/Jdm5QfyM8zdlqT6WVZU4cfP23sot6CEHA4CS49Ezig= -github.com/PuerkitoBio/purell v1.2.0/go.mod h1:OhLRTaaIzhvIyofkJfB24gokC7tM42Px5UhoT32THBk= +github.com/PuerkitoBio/purell v1.2.1 h1:QsZ4TjvwiMpat6gBCBxEQI0rcS9ehtkKtSpiUnd9N28= +github.com/PuerkitoBio/purell v1.2.1/go.mod h1:ZwHcC/82TOaovDi//J/804umJFFmbOHPngi8iYYv/Eo= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -310,12 +310,12 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= -go.bytebuilders.dev/license-proxyserver v0.0.7-0.20231225202028-31122ab82502 h1:825EwUwDMThCiOJs5NZvnSYfWy77oz83FZkpFUwlryM= -go.bytebuilders.dev/license-proxyserver v0.0.7-0.20231225202028-31122ab82502/go.mod h1:U+xAQqopfkri4slwZ/XgwypKDFqHg2t/zO3uDzmPax4= -go.bytebuilders.dev/license-verifier v0.13.4 h1:K4qSsTWTZc7lyRvRHfI23XRrbVrQVJ8Ew5afvSiMdBE= -go.bytebuilders.dev/license-verifier v0.13.4/go.mod h1:lcmFhUSBHp5G0YeZop3I8tOUBRegBrDvkW1aTsIRGcU= -go.bytebuilders.dev/license-verifier/kubernetes v0.13.4 h1:0uPgMbWSHHjB3ECxEGGTIoa4BytSnDSHfTwoxJWv2K4= -go.bytebuilders.dev/license-verifier/kubernetes v0.13.4/go.mod h1:shdo9aT7u3WPAWvFFDTVc/m25HgtYur3d/bknjpAc80= +go.bytebuilders.dev/license-proxyserver v0.0.9 h1:MFArxunIZS0o3LZ+JuSwub8GwZ4bdE3kkfJ8hJfkREQ= +go.bytebuilders.dev/license-proxyserver v0.0.9/go.mod h1:mLX/7EK1gouPWXmG3qibRXF8y+dkR3H1Hgttioy6Dww= +go.bytebuilders.dev/license-verifier v0.14.0 h1:O6pXhz9vz7dPWIJATkX+JiMLhUD2ydzvKzf26c+3Jrw= +go.bytebuilders.dev/license-verifier v0.14.0/go.mod h1:GB9XTSQUcllJ4AVq29TdJI6yRjoI86HGz0XMqq9nLwY= +go.bytebuilders.dev/license-verifier/kubernetes v0.14.0 h1:eeOKHu1YgdHhsaCXf9GNo1ha3SOfaSSe40xG1gc+ArA= +go.bytebuilders.dev/license-verifier/kubernetes v0.14.0/go.mod h1:ms4GTV6vb5eg+dglr8N6EaOybGE77s+kkppFUZ3aZZQ= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= diff --git a/vendor/github.com/PuerkitoBio/purell/purell.go b/vendor/github.com/PuerkitoBio/purell/purell.go index 74c827246..3b086ce82 100644 --- a/vendor/github.com/PuerkitoBio/purell/purell.go +++ b/vendor/github.com/PuerkitoBio/purell/purell.go @@ -86,6 +86,7 @@ var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`) var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`) var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`) var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`) +var rxHostInteriorDots = regexp.MustCompile(`\.+`) var rxEmptyPort = regexp.MustCompile(`:+$`) // Map of flags to implementation function. @@ -368,6 +369,7 @@ func removeUnncessaryHostDots(u *url.URL) { u.Host += matches[2] } } + u.Host = rxHostInteriorDots.ReplaceAllString(u.Host, ".") } } diff --git a/vendor/go.bytebuilders.dev/license-verifier/Makefile b/vendor/go.bytebuilders.dev/license-verifier/Makefile index ac51f2717..0c6cb92fb 100644 --- a/vendor/go.bytebuilders.dev/license-verifier/Makefile +++ b/vendor/go.bytebuilders.dev/license-verifier/Makefile @@ -21,7 +21,7 @@ COMPRESS ?= no # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:maxDescLen=0,generateEmbeddedObjectMeta=true,allowDangerousTypes=true" -CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.25 +CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.29 API_GROUPS ?= licenses:v1alpha1 # Where to push the docker image. @@ -64,7 +64,7 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) BASEIMAGE_PROD ?= gcr.io/distroless/static-debian11 BASEIMAGE_DBG ?= debian:bullseye -GO_VERSION ?= 1.20 +GO_VERSION ?= 1.21 BUILD_IMAGE ?= ghcr.io/appscode/golang-dev:$(GO_VERSION) OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) diff --git a/vendor/go.bytebuilders.dev/license-verifier/kubernetes/lib.go b/vendor/go.bytebuilders.dev/license-verifier/kubernetes/lib.go index 3430a33d1..860720831 100644 --- a/vendor/go.bytebuilders.dev/license-verifier/kubernetes/lib.go +++ b/vendor/go.bytebuilders.dev/license-verifier/kubernetes/lib.go @@ -48,6 +48,7 @@ import ( "k8s.io/klog/v2" "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" core_util "kmodules.xyz/client-go/core/v1" + "kmodules.xyz/client-go/discovery" "kmodules.xyz/client-go/dynamic" "kmodules.xyz/client-go/meta" "kmodules.xyz/client-go/tools/clusterid" @@ -394,3 +395,18 @@ func CheckLicenseEndpoint(config *rest.Config, apiServiceName string, features [ } return nil } + +func LicenseProvided(cfg *rest.Config, licenseFile string) bool { + if licenseFile != "" { + return true + } + + if cfg != nil { + ok, _ := discovery.HasGVK( + kubernetes.NewForConfigOrDie(cfg).Discovery(), + proxyserver.SchemeGroupVersion.String(), + proxyserver.ResourceKindLicenseRequest) + return ok + } + return false +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 6dbbb99dc..b55ed20db 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,8 +1,8 @@ # github.com/Masterminds/semver/v3 v3.2.1 ## explicit; go 1.18 github.com/Masterminds/semver/v3 -# github.com/PuerkitoBio/purell v1.2.0 -## explicit; go 1.19 +# github.com/PuerkitoBio/purell v1.2.1 +## explicit; go 1.21 github.com/PuerkitoBio/purell # github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 ## explicit @@ -175,21 +175,21 @@ github.com/yudai/golcs # github.com/zeebo/xxh3 v1.0.2 ## explicit; go 1.17 github.com/zeebo/xxh3 -# go.bytebuilders.dev/license-proxyserver v0.0.7-0.20231225202028-31122ab82502 -## explicit; go 1.21.5 +# go.bytebuilders.dev/license-proxyserver v0.0.9 +## explicit; go 1.22.0 go.bytebuilders.dev/license-proxyserver/apis/proxyserver go.bytebuilders.dev/license-proxyserver/apis/proxyserver/v1alpha1 go.bytebuilders.dev/license-proxyserver/client/clientset/versioned go.bytebuilders.dev/license-proxyserver/client/clientset/versioned/scheme go.bytebuilders.dev/license-proxyserver/client/clientset/versioned/typed/proxyserver/v1alpha1 -# go.bytebuilders.dev/license-verifier v0.13.4 -## explicit; go 1.18 +# go.bytebuilders.dev/license-verifier v0.14.0 +## explicit; go 1.21 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.13.4 -## explicit; go 1.18 +# go.bytebuilders.dev/license-verifier/kubernetes v0.14.0 +## explicit; go 1.21.5 go.bytebuilders.dev/license-verifier/kubernetes # golang.org/x/exp v0.0.0-20230905200255-921286631fa9 ## explicit; go 1.20 @@ -318,8 +318,6 @@ google.golang.org/protobuf/types/known/timestamppb # gopkg.in/inf.v0 v0.9.1 ## explicit gopkg.in/inf.v0 -# gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 -## explicit # gopkg.in/yaml.v2 v2.4.0 ## explicit; go 1.15 gopkg.in/yaml.v2