diff --git a/Dockerfile b/Dockerfile index 182f423e4c..a7771922cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ # Build the manager binary ARG GO_VERSION -FROM golang:${GO_VERSION:-1.25.9} AS builder +FROM golang:${GO_VERSION:-1.25.10} AS builder WORKDIR /workspace # Run this with docker build --build_arg goproxy=$(go env GOPROXY) to override the goproxy diff --git a/Makefile b/Makefile index 6ecf46333b..c337ae62d3 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ unexport GOPATH TRACE ?= 0 # Go -GO_VERSION ?= 1.25.9 +GO_VERSION ?= 1.25.10 # Ensure correct toolchain is used GOTOOLCHAIN = go$(GO_VERSION) @@ -57,9 +57,10 @@ GO_APIDIFF_BIN := go-apidiff GO_APIDIFF_PKG := github.com/joelanford/go-apidiff # govulncheck -GOVULNCHECK_VER := v1.1.4 +GOVULNCHECK_VER := v1.3.0 GOVULNCHECK_BIN := govulncheck -GOVULNCHECK_PKG := golang.org/x/vuln/cmd/govulncheck +GOVULNCHECK_DIR := hack/tools/govulncheck +GOVULNCHECK_TMP_DIR ?= $(GOVULNCHECK_DIR)/govulncheck.tmp TRIVY_VER := 0.69.3 @@ -81,7 +82,7 @@ RELEASE_NOTES := $(TOOLS_BIN_DIR)/release-notes SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup-envtest GEN_CRD_API_REFERENCE_DOCS := $(TOOLS_BIN_DIR)/gen-crd-api-reference-docs GO_APIDIFF := $(TOOLS_BIN_DIR)/$(GO_APIDIFF_BIN)-$(GO_APIDIFF_VER) -GOVULNCHECK := $(TOOLS_BIN_DIR)/$(GOVULNCHECK_BIN)-$(GOVULNCHECK_VER) +GOVULNCHECK := $(abspath $(TOOLS_BIN_DIR)/$(GOVULNCHECK_BIN)) # Kubebuilder export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.28.0 @@ -276,8 +277,26 @@ $(GO_APIDIFF): # Build go-apidiff. .PHONY: $(GOVULNCHECK_BIN) $(GOVULNCHECK_BIN): $(GOVULNCHECK) ## Build a local copy of govulncheck. -$(GOVULNCHECK): # Build govulncheck. - GOBIN=$(abspath $(TOOLS_BIN_DIR)) $(GO_INSTALL) $(GOVULNCHECK_PKG) $(GOVULNCHECK_BIN) $(GOVULNCHECK_VER) +$(GOVULNCHECK): # Build govulncheck from source with exclusion patch. + @if [ -d "$(GOVULNCHECK_TMP_DIR)" ]; then \ + echo "$(GOVULNCHECK_TMP_DIR) exists, skipping clone"; \ + else \ + git clone "https://github.com/golang/vuln.git" "$(GOVULNCHECK_TMP_DIR)"; \ + cd "$(GOVULNCHECK_TMP_DIR)"; \ + git checkout "$(GOVULNCHECK_VER)"; \ + git apply "$(REPO_ROOT)/$(GOVULNCHECK_DIR)/govulncheck.patch"; \ + fi + @cd "$(REPO_ROOT)/$(GOVULNCHECK_TMP_DIR)"; \ + if [ "$$(git describe --tag 2> /dev/null)" != "$(GOVULNCHECK_VER)" ]; then \ + echo "ERROR: checked out version does not match expected version $(GOVULNCHECK_VER)"; \ + exit 1; \ + fi + @rm -f $(GOVULNCHECK) + go build -C "$(REPO_ROOT)/$(GOVULNCHECK_TMP_DIR)" -o $(GOVULNCHECK) ./cmd/govulncheck + +.PHONY: clean-govulncheck +clean-govulncheck: + rm -fr "$(GOVULNCHECK_TMP_DIR)" ## -------------------------------------- ##@ Linting @@ -691,11 +710,7 @@ verify-container-images: ## Verify container images .PHONY: verify-govulncheck verify-govulncheck: $(GOVULNCHECK) ## Verify code for vulnerabilities - $(GOVULNCHECK) $(GOVULNCHECK_ARGS) ./... && R1=$$? || R1=$$?; \ - $(GOVULNCHECK) $(GOVULNCHECK_ARGS) -C "$(TOOLS_DIR)" ./... && R2=$$? || R2=$$?; \ - if [ "$$R1" -ne "0" ] || [ "$$R2" -ne "0" ]; then \ - exit 1; \ - fi + $(GOVULNCHECK) $(GOVULNCHECK_ARGS) ./... .PHONY: verify-security verify-security: ## Verify code and images for vulnerabilities diff --git a/go.mod b/go.mod index d0b136011e..3d90954e56 100644 --- a/go.mod +++ b/go.mod @@ -12,25 +12,25 @@ require ( github.com/gophercloud/utils/v2 v2.0.0-20241220104409-2e0af06694a1 github.com/hashicorp/go-version v1.9.0 github.com/k-orc/openstack-resource-controller/v2 v2.4.0 - github.com/onsi/ginkgo/v2 v2.28.1 - github.com/onsi/gomega v1.39.1 + github.com/onsi/ginkgo/v2 v2.28.2 + github.com/onsi/gomega v1.41.0 github.com/prometheus/client_golang v1.23.2 github.com/spf13/pflag v1.0.10 go.uber.org/mock v0.6.0 golang.org/x/crypto v0.48.0 golang.org/x/text v0.34.0 - gopkg.in/ini.v1 v1.67.1 - k8s.io/api v0.34.7 - k8s.io/apiextensions-apiserver v0.34.7 - k8s.io/apimachinery v0.34.7 - k8s.io/client-go v0.34.7 - k8s.io/code-generator v0.34.7 - k8s.io/component-base v0.34.7 + gopkg.in/ini.v1 v1.67.2 + k8s.io/api v0.34.8 + k8s.io/apiextensions-apiserver v0.34.8 + k8s.io/apimachinery v0.34.8 + k8s.io/client-go v0.34.8 + k8s.io/code-generator v0.34.8 + k8s.io/component-base v0.34.8 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 - sigs.k8s.io/cluster-api v1.12.7 - sigs.k8s.io/cluster-api/test v1.12.7 + sigs.k8s.io/cluster-api v1.12.8 + sigs.k8s.io/cluster-api/test v1.12.8 sigs.k8s.io/controller-runtime v0.22.5 sigs.k8s.io/structured-merge-diff/v6 v6.4.0 sigs.k8s.io/yaml v1.6.0 @@ -157,7 +157,7 @@ require ( gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiserver v0.34.7 // indirect + k8s.io/apiserver v0.34.8 // indirect k8s.io/cluster-bootstrap v0.34.2 // indirect k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect diff --git a/go.sum b/go.sum index f0b9bcbbbd..0dc8b4c8ec 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,8 @@ github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151X github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/coredns/caddy v1.1.1 h1:2eYKZT7i6yxIfGP3qLJoJ7HAsDJqYB+X68g4NYjSrE0= github.com/coredns/caddy v1.1.1/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4= -github.com/coredns/corefile-migration v1.0.31 h1:f7WGhY8M2Jn8P2dVO0p7wSQ1QKsMARl6WEyUjCb/V38= -github.com/coredns/corefile-migration v1.0.31/go.mod h1:56DPqONc3njpVPsdilEnfijCwNGC3/kTJLl7i7SPavY= +github.com/coredns/corefile-migration v1.0.32 h1:tlbtXBpt7UzmedEoMqnfqOTnGCvzYfJ/Rrfqf+/W+TY= +github.com/coredns/corefile-migration v1.0.32/go.mod h1:56DPqONc3njpVPsdilEnfijCwNGC3/kTJLl7i7SPavY= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= @@ -210,10 +210,10 @@ github.com/olekukonko/ll v0.1.1 h1:9Dfeed5/Mgaxb9lHRAftLK9pVfYETvHn+If6lywVhJc= github.com/olekukonko/ll v0.1.1/go.mod h1:2dJo+hYZcJMLMbKwHEWvxCUbAOLc/CXWS9noET22Mdo= github.com/olekukonko/tablewriter v1.0.9 h1:XGwRsYLC2bY7bNd93Dk51bcPZksWZmLYuaTHR0FqfL8= github.com/olekukonko/tablewriter v1.0.9/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo= -github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= -github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= -github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= -github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/onsi/ginkgo/v2 v2.28.2 h1:DTrMfpqxiNUyQ3Y0zhn1n3cOO2euFgQPYIpkWwxVFps= +github.com/onsi/ginkgo/v2 v2.28.2/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.41.0 h1:OwKp4pXNgVxf6sCplzYo794OFNuoL2q2SBMU5NSWOjA= +github.com/onsi/gomega v1.41.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= @@ -405,29 +405,29 @@ gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSP gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.67.1 h1:tVBILHy0R6e4wkYOn3XmiITt/hEVH4TFMYvAX2Ytz6k= -gopkg.in/ini.v1 v1.67.1/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= +gopkg.in/ini.v1 v1.67.2 h1:JtOSMb9OuaCZKr7h5D/h6iii14sK0hLbplTc6frx4Ss= +gopkg.in/ini.v1 v1.67.2/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= -k8s.io/api v0.34.7 h1:186BQYhLYaaU0jhC4/uC3s4cQ+YSk0BlazRnEldXiqY= -k8s.io/api v0.34.7/go.mod h1:2qet0m0IfHSwXp+RLnunTWADUjy6qaXDa4PdeUnTJ9s= -k8s.io/apiextensions-apiserver v0.34.7 h1:eGo48CGcmTAscn00wumFbo73UWav7jGAht2f1XdNPGQ= -k8s.io/apiextensions-apiserver v0.34.7/go.mod h1:rtx7XxaKq0ZH/9/wWQgA0J4HQqCAnQMwdaMJGmpGwxE= -k8s.io/apimachinery v0.34.7 h1:nkAtvxByvBFSyIyOTrFKcy6pgQ4G1NCKsypWArLdNSY= -k8s.io/apimachinery v0.34.7/go.mod h1:z7dd12Xd400CXIycE8nmn32xZhApV9zskHs0A5xeU/Q= -k8s.io/apiserver v0.34.7 h1:G0JG/NTBN+FDYxF9r15dmj7vA8Gn3QH06kg8un9N+6c= -k8s.io/apiserver v0.34.7/go.mod h1:7+me/mC1L/BRkb7MbUwUpppl/BNodyt28bgVmytocrs= -k8s.io/client-go v0.34.7 h1:zxksYcHi4DMv6HfjMbHTfcV3jYZh7BY3yH18maoRxsA= -k8s.io/client-go v0.34.7/go.mod h1:GS3K60t9FI20+l3cvB/EfDXyD+JoKr3suIjSGISQLDc= +k8s.io/api v0.34.8 h1:PATray7Ixf5fzuvW6WTrLGqWpaeSUlV3NqygBu10YC0= +k8s.io/api v0.34.8/go.mod h1:kkv5KLONEBxemk51GDsqR0TaBig60bVriYyDj9v3gg8= +k8s.io/apiextensions-apiserver v0.34.8 h1:iovXsJk6GKQdgEQFpeTJcFHGVGx576gyAA3StSkwNk0= +k8s.io/apiextensions-apiserver v0.34.8/go.mod h1:hmkveoSZ3WH4HBMc/FcraqfPbASAZ/TbAfaHFfiEvlY= +k8s.io/apimachinery v0.34.8 h1:Vjyd/TdakksL0g7ikxyaAk3s3qgqRRYz9vj0AudwNzc= +k8s.io/apimachinery v0.34.8/go.mod h1:z7dd12Xd400CXIycE8nmn32xZhApV9zskHs0A5xeU/Q= +k8s.io/apiserver v0.34.8 h1:7U+r8jBO6ylt2FwctZ6EELrDKqxIae7gBOWmA7de8x8= +k8s.io/apiserver v0.34.8/go.mod h1:O7qPTh4MwdivMzMubIg8ij90DEzPmZymhXcmisORa68= +k8s.io/client-go v0.34.8 h1:/4Ar6TX6V/vwhFQDeTMySO0+OBbslk7inkEdOQdR66A= +k8s.io/client-go v0.34.8/go.mod h1:VVLUD4GP16X+ePPZ3YpCyxn1rhaf1lczr/HCI0e40h8= k8s.io/cluster-bootstrap v0.34.2 h1:oKckPeunVCns37BntcsxaOesDul32yzGd3DFLjW2fc8= k8s.io/cluster-bootstrap v0.34.2/go.mod h1:f21byPR7X5nt12ivZi+J3pb4sG4SH6VySX8KAAJA8BY= -k8s.io/code-generator v0.34.7 h1:JSFAiGIcMnDLdUilaP3ZSXshHpPH1Elogw6wHpxeNHI= -k8s.io/code-generator v0.34.7/go.mod h1:GbTJ/TjHYE2WWDgV+9q1VTI4UkU5wGLnD2koZW0mkPY= -k8s.io/component-base v0.34.7 h1:MbY8LBCV7+SFzXGdFTxmjCodpeg+lEBVOPBzmbKuD7I= -k8s.io/component-base v0.34.7/go.mod h1:8nuSOhmTwQ3lz79kDPXtLD7NviHYhAF8vAgX++NCgiY= +k8s.io/code-generator v0.34.8 h1:J2+jOASoj+Y0cDdypMAIiD3/bKqpfteRx8rLsYdnMCk= +k8s.io/code-generator v0.34.8/go.mod h1:q+hSPDPvkqknwUcUX5TtuGqI6GoRFSmN4PWLcHql/i0= +k8s.io/component-base v0.34.8 h1:CFjleHdJedIBpSLGxgu0wqv2EF5uS3LdQcylmd3+p9c= +k8s.io/component-base v0.34.8/go.mod h1:edr4D/ZHFfFlibLHgkeNE9n6VivYw/7Rp+reFPV5k7w= k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f h1:SLb+kxmzfA87x4E4brQzB33VBbT2+x7Zq9ROIHmGn9Q= k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= @@ -440,10 +440,10 @@ pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/cluster-api v1.12.7 h1:CbRMWgKN/sHZGBWc/6s8DH9ZnqsSsmYDKlJJ69Rxt8o= -sigs.k8s.io/cluster-api v1.12.7/go.mod h1:RdmTGGRMvAGIIQBljHUHNov/6Lgz7rmYXqzZNCK+Z4o= -sigs.k8s.io/cluster-api/test v1.12.7 h1:V6ebtlQq+2veIhQoXMitwOoSQE1JHJoKxe+1T7cvFCk= -sigs.k8s.io/cluster-api/test v1.12.7/go.mod h1:Q6nLgHZXUzi9Wj47DHBrp8NG9dTfRBtBa5iNwtIW45c= +sigs.k8s.io/cluster-api v1.12.8 h1:37SLcQRG9EMhmsZJwyEx8pNBkmY1Xhog53slhDy44m4= +sigs.k8s.io/cluster-api v1.12.8/go.mod h1:Xz6YnayDc2+/3OA1i6wlXrhmErV1KKJmyfs7JzMDn+k= +sigs.k8s.io/cluster-api/test v1.12.8 h1:nqtdKluVj/ZUXYlQNGmvIEG/Z0Bh0oihc4NCpPcZWVc= +sigs.k8s.io/cluster-api/test v1.12.8/go.mod h1:Ol1iUdCI7HnUKjT5KTsSBxMzHsTlpxGfdtLfy5g3/RI= sigs.k8s.io/controller-runtime v0.22.5 h1:v3nfSUMowX/2WMp27J9slwGFyAt7IV0YwBxAkrUr0GE= sigs.k8s.io/controller-runtime v0.22.5/go.mod h1:pc5SoYWnWI6I+cBHYYdZ7B6YHZVY5xNfll88JB+vniI= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= diff --git a/hack/tools/go.mod b/hack/tools/go.mod index 9b14b443b9..e522732d03 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -6,9 +6,9 @@ require ( github.com/a8m/envsubst v1.4.3 github.com/ahmetb/gen-crd-api-reference-docs v0.3.1-0.20220420215017-3f29e6853552 github.com/itchyny/gojq v0.12.19 - github.com/onsi/ginkgo/v2 v2.28.1 + github.com/onsi/ginkgo/v2 v2.28.2 go.uber.org/mock v0.6.0 - k8s.io/code-generator v0.34.7 + k8s.io/code-generator v0.34.8 sigs.k8s.io/cluster-api-provider-openstack v0.0.0 sigs.k8s.io/cluster-api/hack/tools v0.0.0-20250805173327-a7b9f27af519 sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250620151452-b9a9ca01fd37 @@ -87,7 +87,7 @@ require ( github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481 // indirect - github.com/onsi/gomega v1.39.1 // indirect + github.com/onsi/gomega v1.41.0 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -141,13 +141,13 @@ require ( gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.34.7 // indirect - k8s.io/apiextensions-apiserver v0.34.7 // indirect - k8s.io/apimachinery v0.34.7 // indirect - k8s.io/apiserver v0.34.7 // indirect - k8s.io/client-go v0.34.7 // indirect + k8s.io/api v0.34.8 // indirect + k8s.io/apiextensions-apiserver v0.34.8 // indirect + k8s.io/apimachinery v0.34.8 // indirect + k8s.io/apiserver v0.34.8 // indirect + k8s.io/client-go v0.34.8 // indirect k8s.io/cluster-bootstrap v0.34.2 // indirect - k8s.io/component-base v0.34.7 // indirect + k8s.io/component-base v0.34.8 // indirect k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9 // indirect k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f // indirect k8s.io/klog v0.2.0 // indirect @@ -156,7 +156,7 @@ require ( k8s.io/release v0.16.9 // indirect k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect - sigs.k8s.io/cluster-api v1.12.7 // indirect + sigs.k8s.io/cluster-api v1.12.8 // indirect sigs.k8s.io/controller-runtime v0.22.5 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20211028165026-57688c578b5d // indirect diff --git a/hack/tools/go.sum b/hack/tools/go.sum index 89850e8c32..0f1b07c626 100644 --- a/hack/tools/go.sum +++ b/hack/tools/go.sum @@ -53,8 +53,8 @@ github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151X github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/coredns/caddy v1.1.1 h1:2eYKZT7i6yxIfGP3qLJoJ7HAsDJqYB+X68g4NYjSrE0= github.com/coredns/caddy v1.1.1/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4= -github.com/coredns/corefile-migration v1.0.31 h1:f7WGhY8M2Jn8P2dVO0p7wSQ1QKsMARl6WEyUjCb/V38= -github.com/coredns/corefile-migration v1.0.31/go.mod h1:56DPqONc3njpVPsdilEnfijCwNGC3/kTJLl7i7SPavY= +github.com/coredns/corefile-migration v1.0.32 h1:tlbtXBpt7UzmedEoMqnfqOTnGCvzYfJ/Rrfqf+/W+TY= +github.com/coredns/corefile-migration v1.0.32/go.mod h1:56DPqONc3njpVPsdilEnfijCwNGC3/kTJLl7i7SPavY= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= @@ -255,10 +255,10 @@ github.com/olekukonko/tablewriter v1.0.9 h1:XGwRsYLC2bY7bNd93Dk51bcPZksWZmLYuaTH github.com/olekukonko/tablewriter v1.0.9/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= -github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= -github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= -github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/onsi/ginkgo/v2 v2.28.2 h1:DTrMfpqxiNUyQ3Y0zhn1n3cOO2euFgQPYIpkWwxVFps= +github.com/onsi/ginkgo/v2 v2.28.2/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.41.0 h1:OwKp4pXNgVxf6sCplzYo794OFNuoL2q2SBMU5NSWOjA= +github.com/onsi/gomega v1.41.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= @@ -477,22 +477,22 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.34.7 h1:186BQYhLYaaU0jhC4/uC3s4cQ+YSk0BlazRnEldXiqY= -k8s.io/api v0.34.7/go.mod h1:2qet0m0IfHSwXp+RLnunTWADUjy6qaXDa4PdeUnTJ9s= -k8s.io/apiextensions-apiserver v0.34.7 h1:eGo48CGcmTAscn00wumFbo73UWav7jGAht2f1XdNPGQ= -k8s.io/apiextensions-apiserver v0.34.7/go.mod h1:rtx7XxaKq0ZH/9/wWQgA0J4HQqCAnQMwdaMJGmpGwxE= -k8s.io/apimachinery v0.34.7 h1:nkAtvxByvBFSyIyOTrFKcy6pgQ4G1NCKsypWArLdNSY= -k8s.io/apimachinery v0.34.7/go.mod h1:z7dd12Xd400CXIycE8nmn32xZhApV9zskHs0A5xeU/Q= -k8s.io/apiserver v0.34.7 h1:G0JG/NTBN+FDYxF9r15dmj7vA8Gn3QH06kg8un9N+6c= -k8s.io/apiserver v0.34.7/go.mod h1:7+me/mC1L/BRkb7MbUwUpppl/BNodyt28bgVmytocrs= -k8s.io/client-go v0.34.7 h1:zxksYcHi4DMv6HfjMbHTfcV3jYZh7BY3yH18maoRxsA= -k8s.io/client-go v0.34.7/go.mod h1:GS3K60t9FI20+l3cvB/EfDXyD+JoKr3suIjSGISQLDc= +k8s.io/api v0.34.8 h1:PATray7Ixf5fzuvW6WTrLGqWpaeSUlV3NqygBu10YC0= +k8s.io/api v0.34.8/go.mod h1:kkv5KLONEBxemk51GDsqR0TaBig60bVriYyDj9v3gg8= +k8s.io/apiextensions-apiserver v0.34.8 h1:iovXsJk6GKQdgEQFpeTJcFHGVGx576gyAA3StSkwNk0= +k8s.io/apiextensions-apiserver v0.34.8/go.mod h1:hmkveoSZ3WH4HBMc/FcraqfPbASAZ/TbAfaHFfiEvlY= +k8s.io/apimachinery v0.34.8 h1:Vjyd/TdakksL0g7ikxyaAk3s3qgqRRYz9vj0AudwNzc= +k8s.io/apimachinery v0.34.8/go.mod h1:z7dd12Xd400CXIycE8nmn32xZhApV9zskHs0A5xeU/Q= +k8s.io/apiserver v0.34.8 h1:7U+r8jBO6ylt2FwctZ6EELrDKqxIae7gBOWmA7de8x8= +k8s.io/apiserver v0.34.8/go.mod h1:O7qPTh4MwdivMzMubIg8ij90DEzPmZymhXcmisORa68= +k8s.io/client-go v0.34.8 h1:/4Ar6TX6V/vwhFQDeTMySO0+OBbslk7inkEdOQdR66A= +k8s.io/client-go v0.34.8/go.mod h1:VVLUD4GP16X+ePPZ3YpCyxn1rhaf1lczr/HCI0e40h8= k8s.io/cluster-bootstrap v0.34.2 h1:oKckPeunVCns37BntcsxaOesDul32yzGd3DFLjW2fc8= k8s.io/cluster-bootstrap v0.34.2/go.mod h1:f21byPR7X5nt12ivZi+J3pb4sG4SH6VySX8KAAJA8BY= -k8s.io/code-generator v0.34.7 h1:JSFAiGIcMnDLdUilaP3ZSXshHpPH1Elogw6wHpxeNHI= -k8s.io/code-generator v0.34.7/go.mod h1:GbTJ/TjHYE2WWDgV+9q1VTI4UkU5wGLnD2koZW0mkPY= -k8s.io/component-base v0.34.7 h1:MbY8LBCV7+SFzXGdFTxmjCodpeg+lEBVOPBzmbKuD7I= -k8s.io/component-base v0.34.7/go.mod h1:8nuSOhmTwQ3lz79kDPXtLD7NviHYhAF8vAgX++NCgiY= +k8s.io/code-generator v0.34.8 h1:J2+jOASoj+Y0cDdypMAIiD3/bKqpfteRx8rLsYdnMCk= +k8s.io/code-generator v0.34.8/go.mod h1:q+hSPDPvkqknwUcUX5TtuGqI6GoRFSmN4PWLcHql/i0= +k8s.io/component-base v0.34.8 h1:CFjleHdJedIBpSLGxgu0wqv2EF5uS3LdQcylmd3+p9c= +k8s.io/component-base v0.34.8/go.mod h1:edr4D/ZHFfFlibLHgkeNE9n6VivYw/7Rp+reFPV5k7w= k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9 h1:1bLA4Agvs1DILmc+q2Bbcqjx6jOHO7YEFA+G+0aTZoc= k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo/v2 v2.0.0-20250604051438-85fd79dbfd9f h1:SLb+kxmzfA87x4E4brQzB33VBbT2+x7Zq9ROIHmGn9Q= @@ -510,12 +510,12 @@ k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8 k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/cluster-api v1.12.7 h1:CbRMWgKN/sHZGBWc/6s8DH9ZnqsSsmYDKlJJ69Rxt8o= -sigs.k8s.io/cluster-api v1.12.7/go.mod h1:RdmTGGRMvAGIIQBljHUHNov/6Lgz7rmYXqzZNCK+Z4o= +sigs.k8s.io/cluster-api v1.12.8 h1:37SLcQRG9EMhmsZJwyEx8pNBkmY1Xhog53slhDy44m4= +sigs.k8s.io/cluster-api v1.12.8/go.mod h1:Xz6YnayDc2+/3OA1i6wlXrhmErV1KKJmyfs7JzMDn+k= sigs.k8s.io/cluster-api/hack/tools v0.0.0-20250805173327-a7b9f27af519 h1:WkOO6Fg3tmbuFXqTMFfs80mapaQyBbdIC5p86LIVlBI= sigs.k8s.io/cluster-api/hack/tools v0.0.0-20250805173327-a7b9f27af519/go.mod h1:/Zjkh19AmjuI4piKJ1fAZW7k0cDZsSoAAcGHKGZJTZU= -sigs.k8s.io/cluster-api/test v1.12.7 h1:V6ebtlQq+2veIhQoXMitwOoSQE1JHJoKxe+1T7cvFCk= -sigs.k8s.io/cluster-api/test v1.12.7/go.mod h1:Q6nLgHZXUzi9Wj47DHBrp8NG9dTfRBtBa5iNwtIW45c= +sigs.k8s.io/cluster-api/test v1.12.8 h1:nqtdKluVj/ZUXYlQNGmvIEG/Z0Bh0oihc4NCpPcZWVc= +sigs.k8s.io/cluster-api/test v1.12.8/go.mod h1:Ol1iUdCI7HnUKjT5KTsSBxMzHsTlpxGfdtLfy5g3/RI= sigs.k8s.io/controller-runtime v0.22.5 h1:v3nfSUMowX/2WMp27J9slwGFyAt7IV0YwBxAkrUr0GE= sigs.k8s.io/controller-runtime v0.22.5/go.mod h1:pc5SoYWnWI6I+cBHYYdZ7B6YHZVY5xNfll88JB+vniI= sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250620151452-b9a9ca01fd37 h1:NSnbH7C6/fYc5L3FxMQiSlFBqYi+32LnFsXwArzOlIM= diff --git a/hack/tools/govulncheck/.gitignore b/hack/tools/govulncheck/.gitignore new file mode 100644 index 0000000000..8396eea084 --- /dev/null +++ b/hack/tools/govulncheck/.gitignore @@ -0,0 +1 @@ +govulncheck.tmp/ diff --git a/hack/tools/govulncheck/govulncheck.patch b/hack/tools/govulncheck/govulncheck.patch new file mode 100644 index 0000000000..2f826666bc --- /dev/null +++ b/hack/tools/govulncheck/govulncheck.patch @@ -0,0 +1,200 @@ +diff --git a/README.md b/README.md +index 0af935a..8db6157 100644 +--- a/README.md ++++ b/README.md +@@ -1,5 +1,23 @@ + # Go Vulnerability Management + ++This is a fork of the govulncheck tool which adds the ability to exclude specific ++vulnerebalities. ++ ++It is configured through the `.govuln_exclude` file by default which takes the following format ++``` ++# Some comment about why the vulnerability is excluded ++GO-2026-4880 ++``` ++The file should contain the ID of 1 excluded vulnerability per line. ++Only lines starting with `GO-` are considered vulnerability identifiers. ++Any other lines will be discarded. ++ ++If the file is missing or parsing otherwise fails, an empty excluded list will be used. ++ ++This should make the tool a drop-in replacement for govulncheck. ++ ++ ++## Original README + [![Go Reference](https://pkg.go.dev/badge/golang.org/x/vuln.svg)](https://pkg.go.dev/golang.org/x/vuln) + + Go's support for vulnerability management includes tooling for analyzing your +diff --git a/internal/govulncheck/govulncheck.go b/internal/govulncheck/govulncheck.go +index 377a378..aca9f41 100644 +--- a/internal/govulncheck/govulncheck.go ++++ b/internal/govulncheck/govulncheck.go +@@ -84,6 +84,10 @@ type Config struct { + // what to do with it. Valid values are source, binary, query, + // and extract. + ScanMode ScanMode `json:"scan_mode,omitempty"` ++ ++ // ExcludedVulnerabilites contains a set of go vuln identifiers that will be ++ // ignored if they are present in the output ++ ExcludedVulnerabilites map[string]struct{} `json:"excluded_vulnerabilities,omitempty"` + } + + // SBOM contains minimal information about the artifacts govulncheck is scanning. +diff --git a/internal/govulncheck/jsonhandler.go b/internal/govulncheck/jsonhandler.go +index b1586e0..51c2f02 100644 +--- a/internal/govulncheck/jsonhandler.go ++++ b/internal/govulncheck/jsonhandler.go +@@ -13,6 +13,7 @@ import ( + ) + + type jsonHandler struct { ++ cfg *Config + enc *json.Encoder + } + +@@ -25,6 +26,7 @@ func NewJSONHandler(w io.Writer) Handler { + + // Config writes config block in JSON to the underlying writer. + func (h *jsonHandler) Config(config *Config) error { ++ h.cfg = config + return h.enc.Encode(Message{Config: config}) + } + +@@ -45,5 +47,9 @@ func (h *jsonHandler) OSV(entry *osv.Entry) error { + + // Finding writes a finding in JSON to the underlying writer. + func (h *jsonHandler) Finding(finding *Finding) error { ++ // Return early if the finding is excluded ++ if _, ok := h.cfg.ExcludedVulnerabilites[finding.OSV]; ok { ++ return nil ++ } + return h.enc.Encode(Message{Finding: finding}) + } +diff --git a/internal/openvex/handler.go b/internal/openvex/handler.go +index a2d3282..5a5e80b 100644 +--- a/internal/openvex/handler.go ++++ b/internal/openvex/handler.go +@@ -109,6 +109,10 @@ func moreSpecific(f1, f2 *govulncheck.Finding) int { + } + + func (h *handler) Finding(f *govulncheck.Finding) error { ++ // Return early if the finding is ignored ++ if _, ok := h.cfg.ExcludedVulnerabilites[f.OSV]; ok { ++ return nil ++ } + fs := h.findings[f.OSV] + if len(fs) == 0 { + fs = []*govulncheck.Finding{f} +diff --git a/internal/sarif/handler.go b/internal/sarif/handler.go +index d9e585b..b2d0dcd 100644 +--- a/internal/sarif/handler.go ++++ b/internal/sarif/handler.go +@@ -87,6 +87,10 @@ func moreSpecific(f1, f2 *govulncheck.Finding) int { + } + + func (h *handler) Finding(f *govulncheck.Finding) error { ++ // Return early if the OSV is excluded ++ if _, ok := h.cfg.ExcludedVulnerabilites[f.OSV]; ok { ++ return nil ++ } + fs := h.findings[f.OSV] + if len(fs) == 0 { + fs = []*govulncheck.Finding{f} +diff --git a/internal/scan/flags.go b/internal/scan/flags.go +index e67c0a1..5c1871f 100644 +--- a/internal/scan/flags.go ++++ b/internal/scan/flags.go +@@ -27,6 +27,7 @@ type config struct { + format FormatFlag + version bool + env []string ++ exclude string + } + + func parseFlags(cfg *config, stderr io.Writer, args []string) error { +@@ -46,6 +47,7 @@ func parseFlags(cfg *config, stderr io.Writer, args []string) error { + flags.Var(&cfg.format, "format", "specify format output\nThe supported values are 'text', 'json', 'sarif', and 'openvex' (default 'text')") + flags.BoolVar(&version, "version", false, "print the version information") + flags.Var(&scanFlag, "scan", "set the scanning level desired, one of 'module', 'package', or 'symbol' (default 'symbol')") ++ flags.StringVar(&cfg.exclude, "exclude", ".govuln_exclude", "path to a file containing vulnerabilities to exclude (default '.govuln_exclude')") + + // We don't want to print the whole usage message on each flags + // error, so we set to a no-op and do the printing ourselves. +diff --git a/internal/scan/run.go b/internal/scan/run.go +index 5f6a641..1ae1e0e 100644 +--- a/internal/scan/run.go ++++ b/internal/scan/run.go +@@ -5,9 +5,11 @@ + package scan + + import ( ++ "bufio" + "context" + "fmt" + "io" ++ "os" + "os/exec" + "path" + "path/filepath" +@@ -104,6 +106,30 @@ func prepareConfig(ctx context.Context, cfg *config, client *client.Client) { + if mod, err := client.LastModifiedTime(ctx); err == nil { + cfg.DBLastModified = &mod + } ++ ++ cfg.ExcludedVulnerabilites = excludedVulns(cfg.exclude) ++} ++ ++// excludedVulns loads a list of vulnerability IDs to ignore from the given filepath ++// If the file is not present, or cannot be parsed, an empty set will be returned ++func excludedVulns(file string) map[string]struct{} { ++ output := make(map[string]struct{}) ++ fd, err := os.Open(file) ++ if err != nil { ++ return output ++ } ++ scanner := bufio.NewScanner(fd) ++ for scanner.Scan() { ++ line := scanner.Text() ++ line = strings.TrimSpace(line) ++ if strings.HasPrefix(line, "GO-") { ++ output[line] = struct{}{} ++ } ++ } ++ if scanner.Err() != nil { ++ return make(map[string]struct{}) ++ } ++ return output + } + + // scannerVersion reconstructs the current version of +diff --git a/internal/scan/text.go b/internal/scan/text.go +index ab49bdd..6eb6270 100644 +--- a/internal/scan/text.go ++++ b/internal/scan/text.go +@@ -40,6 +40,7 @@ type TextHandler struct { + findings []*findingSummary + scanLevel govulncheck.ScanLevel + scanMode govulncheck.ScanMode ++ excluded map[string]struct{} + + err error + +@@ -91,6 +92,7 @@ func (h *TextHandler) Flush() error { + func (h *TextHandler) Config(config *govulncheck.Config) error { + h.scanLevel = config.ScanLevel + h.scanMode = config.ScanMode ++ h.excluded = config.ExcludedVulnerabilites + + if !h.showVersion { + return nil +@@ -182,6 +184,9 @@ func (h *TextHandler) OSV(entry *osv.Entry) error { + + // Finding gathers vulnerability findings to be written. + func (h *TextHandler) Finding(finding *govulncheck.Finding) error { ++ if _, ok := h.excluded[finding.OSV]; ok { ++ return nil ++ } + if err := validateFindings(finding); err != nil { + return err + } diff --git a/netlify.toml b/netlify.toml index 1766771b7b..8955b349fd 100644 --- a/netlify.toml +++ b/netlify.toml @@ -4,7 +4,7 @@ command = "make -C docs/book build" publish = "docs/book/book" [build.environment] -GO_VERSION = "1.25.9" +GO_VERSION = "1.25.10" # Standard Netlify redirects [[redirects]] diff --git a/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md b/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md index 70050f35d1..2233136e60 100644 --- a/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md +++ b/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md @@ -1,3 +1,12 @@ +## 2.28.2 + +- Add ArtifactDir() to support Go 1.26 testing.TB interface [f3a36b6] +- Implement shell completion [94151c8] +- Add asan CLI option mirroring msan implementation [4d21dbb] +- Bump uri from 1.0.3 to 1.0.4 in /docs (#1630) [c102161] +- fix aspect ratio [9619647] +- update logos [5779304] + ## 2.28.1 Update all dependencies. This auto-updated the required version of Go to 1.24, consistent with the fact that Go 1.23 has been out of support for almost six months. diff --git a/vendor/github.com/onsi/ginkgo/v2/README.md b/vendor/github.com/onsi/ginkgo/v2/README.md index b4c3ce0ad2..6d36e377eb 100644 --- a/vendor/github.com/onsi/ginkgo/v2/README.md +++ b/vendor/github.com/onsi/ginkgo/v2/README.md @@ -120,6 +120,6 @@ Sponsors commit to a [sponsorship](https://github.com/sponsors/onsi) for a year.

Browser testing via - +

diff --git a/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go b/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go index c3f6d3a11e..53114904ca 100644 --- a/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go +++ b/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go @@ -1,9 +1,13 @@ package command import ( + "bufio" "fmt" "io" + "maps" "os" + "path/filepath" + "slices" "strings" "github.com/onsi/ginkgo/v2/formatter" @@ -158,6 +162,166 @@ func (p Program) handleHelpRequestsAndExit(writer io.Writer, args []string) { } } +type completionOptions = struct { + Complete bool + Install bool +} + +func (p *Program) BuildCompletionCommand() Command { + opts := completionOptions{} + flags, err := types.NewGinkgoFlagSet( + types.GinkgoFlags{ + {Name: "complete", KeyPath: "Complete", Usage: "Generate completion for arguments after --"}, + {Name: "install", KeyPath: "Install", Usage: "Install shell completion script into $XDG_DATA_HOME, ~/.local/share"}, + }, + &opts, + types.GinkgoFlagSections{}, + ) + if err != nil { + panic(err) + } + return Command{ + Name: "completion", + Usage: "ginkgo completion [-- ]", + Flags: flags, + ShortDoc: "Generate shell completion", + Documentation: `To use install completion script for your shell (bash, fish, zsh). +Or load completion code by: {{bold}}source <(ginkgo completion ){{/}}.`, + Command: func(args []string, completeArgs []string) { + p.handleCompletionAndExit(args, completeArgs, opts) + }, + } +} + +func (p Program) generateShellCompletionScript(shell string) (scriptPath string, script string) { + switch shell { + case "bash": + scriptPath = fmt.Sprintf("bash-completion/completions/%s", p.Name) + script = fmt.Sprintf(`__%s_complete_bash() { + mapfile -t COMPREPLY < <("${COMP_WORDS[0]}" completion --complete bash -- "${COMP_WORDS[@]:1:COMP_CWORD}") +} +complete -o bashdefault -o default -F __%[1]s_complete_bash %[1]s +`, p.Name) + + case "fish": + scriptPath = fmt.Sprintf("fish/vendor_completions.d/%s.fish", p.Name) + script = fmt.Sprintf(`function __fish_%[1]s_complete + set -l args (commandline -opc) (commandline -ct) + set -e args[1] + %[1]s completion --complete fish -- $args +end +complete -c %[1]s -a "(__fish_%[1]s_complete)" +`, p.Name) + + case "zsh": + scriptPath = fmt.Sprintf("zsh/site-functions/_%s", p.Name) + script = fmt.Sprintf(`#compdef %[1]s +_%[1]s() { + local -a completions + completions=(${(f)"$("${words[1]}" completion --complete zsh -- "${words[@]:1:$((CURRENT-1))}")"}) + if (( ${#completions[@]} )); then + _describe 'completions' completions + else + _default + fi +} +compdef _%[1]s %[1]s +if [ "$funcstack[1]" = "_%[1]s" ]; then + _%[1]s +fi +`, p.Name) + + case "": + AbortWithUsage("Shell is not specified") + default: + AbortWith("Shell %q is not supported yet. Choose: bash, fish, zsh", shell) + } + + return scriptPath, script +} + +func (p Program) handleCompletionAndExit(args, completeArgs []string, opts completionOptions) { + writer := p.OutWriter + if writer == nil { + writer = os.Stdout + } + buffer := bufio.NewWriter(writer) + defer buffer.Flush() + + var shell string + if len(args) > 0 { + shell = args[0] + } + + if !opts.Complete { + scriptPath, script := p.generateShellCompletionScript(shell) + if opts.Install { + dataHomeDir := os.Getenv("XDG_DATA_HOME") + if dataHomeDir == "" { + userHomeDir, err := os.UserHomeDir() + AbortIfError("Failed to find home", err) + dataHomeDir = filepath.Join(userHomeDir, ".local/share") + } + scriptPath = filepath.Join(dataHomeDir, scriptPath) + fmt.Fprintf(buffer, "Installing completion script: %v\n", scriptPath) + err := os.WriteFile(scriptPath, []byte(script), 0644) + AbortIfError("Failed to install completion script", err) + } else { + buffer.Write([]byte(script)) + } + Abort(AbortDetails{}) + } + + var lastArg string + var result map[string]string + if len(completeArgs) > 0 { + lastArg = completeArgs[len(completeArgs)-1] + } + + if delim := slices.Index(completeArgs, "--"); delim >= 0 && delim != len(completeArgs)-1 { + // No completion for pass-through arguments after "--" + } else if len(lastArg) > 0 && lastArg[0] == '-' { + // Complete flags + cmd := &p.DefaultCommand + for i := range p.Commands { + if p.Commands[i].Name == completeArgs[0] { + cmd = &p.Commands[i] + break + } + } + result = cmd.Flags.Completion(lastArg) + } else if len(completeArgs) <= 1 { + // Complete commands + result = make(map[string]string, len(p.Commands)+1) + for _, cmd := range append(p.Commands, p.DefaultCommand) { + if strings.HasPrefix(cmd.Name, lastArg) { + result[cmd.Name] = cmd.Usage + } + } + } + + width := 0 + for suggest := range result { + width = max(width, len(suggest)) + } + + for _, suggest := range slices.Sorted(maps.Keys(result)) { + usage := result[suggest] + switch { + case shell == "bash" && usage != "" && len(result) > 1: + fmt.Fprintf(buffer, "%*s (%s)\n", -width-2, suggest, usage) + case shell == "fish": + fmt.Fprintf(buffer, "%s\t%s\n", suggest, usage) + case shell == "zsh": + fmt.Fprintf(buffer, "%s:%s\n", suggest, usage) + default: + fmt.Fprintln(buffer, suggest) + } + } + + Abort(AbortDetails{}) +} + func (p Program) EmitUsage(writer io.Writer) { fmt.Fprintln(writer, formatter.F(p.Heading)) fmt.Fprintln(writer, formatter.F("{{gray}}%s{{/}}", strings.Repeat("-", len(p.Heading)))) diff --git a/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go b/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go index 419589b48c..596c210cf1 100644 --- a/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go +++ b/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go @@ -41,6 +41,7 @@ func main() { {Name: "nodot", Deprecation: types.Deprecations.Nodot()}, }, } + program.Commands = append(program.Commands, program.BuildCompletionCommand()) program.RunAndExit(os.Args) } diff --git a/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go b/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go index 40d1e1ab5c..db3e248470 100644 --- a/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go +++ b/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go @@ -72,6 +72,7 @@ type GinkgoTInterface interface { TempDir() string Attr(key, value string) Output() io.Writer + ArtifactDir() string } /* @@ -196,3 +197,6 @@ func (g *GinkgoTBWrapper) Attr(key, value string) { func (g *GinkgoTBWrapper) Output() io.Writer { return g.GinkgoT.Output() } +func (g *GinkgoTBWrapper) ArtifactDir() string { + return g.GinkgoT.ArtifactDir() +} diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go b/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go index 5704f0fdf9..e6fbaee416 100644 --- a/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go +++ b/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go @@ -181,6 +181,15 @@ func (t *ginkgoTestingTProxy) TempDir() string { return tmpDir } +func (t *ginkgoTestingTProxy) ArtifactDir() string { + artifactDir, err := os.MkdirTemp("", "ginkgo") + if err != nil { + t.fail(fmt.Sprintf("Failed to create artifact directory: %v", err), 1) + return "" + } + return artifactDir +} + // FullGinkgoTInterface func (t *ginkgoTestingTProxy) AddReportEntryVisibilityAlways(name string, args ...any) { finalArgs := []any{internal.Offset(1), types.ReportEntryVisibilityAlways} diff --git a/vendor/github.com/onsi/ginkgo/v2/types/config.go b/vendor/github.com/onsi/ginkgo/v2/types/config.go index f847036046..ca64acb27a 100644 --- a/vendor/github.com/onsi/ginkgo/v2/types/config.go +++ b/vendor/github.com/onsi/ginkgo/v2/types/config.go @@ -215,6 +215,7 @@ type GoFlagsConfig struct { N bool ModFile string ModCacheRW bool + ASan bool MSan bool PkgDir string Tags string @@ -570,6 +571,8 @@ var GoBuildFlags = GinkgoFlags{ Usage: "leave newly-created directories in the module cache read-write instead of making them read-only."}, {KeyPath: "Go.ModFile", Name: "modfile", UsageArgument: "file", SectionKey: "go-build", Usage: `in module aware mode, read (and possibly write) an alternate go.mod file instead of the one in the module root directory. A file named go.mod must still be present in order to determine the module root directory, but it is not accessed. When -modfile is specified, an alternate go.sum file is also used: its path is derived from the -modfile flag by trimming the ".mod" extension and appending ".sum".`}, + {KeyPath: "Go.ASan", Name: "asan", SectionKey: "go-build", + Usage: "enable interoperation with address sanitizer."}, {KeyPath: "Go.MSan", Name: "msan", SectionKey: "go-build", Usage: "enable interoperation with memory sanitizer. Supported only on linux/amd64, linux/arm64 and only with Clang/LLVM as the host C compiler. On linux/arm64, pie build mode will be used."}, {KeyPath: "Go.N", Name: "n", SectionKey: "go-build", diff --git a/vendor/github.com/onsi/ginkgo/v2/types/flags.go b/vendor/github.com/onsi/ginkgo/v2/types/flags.go index 8409653f97..eb04c3e78a 100644 --- a/vendor/github.com/onsi/ginkgo/v2/types/flags.go +++ b/vendor/github.com/onsi/ginkgo/v2/types/flags.go @@ -212,6 +212,24 @@ func (f GinkgoFlagSet) IsZero() bool { return f.flagSet == nil } +func (f GinkgoFlagSet) Completion(arg string) map[string]string { + if f.IsZero() { + return nil + } + prefix := strings.TrimLeft(arg, "-") + dash := arg[:len(arg)-len(prefix)] + if len(dash) < 1 || len(dash) > 3 { + return nil + } + result := make(map[string]string, len(f.flags)) + for _, flag := range f.flags { + if flag.Name != "" && strings.HasPrefix(flag.Name, prefix) { + result[dash+flag.Name] = flag.Usage + } + } + return result +} + func (f GinkgoFlagSet) WasSet(name string) bool { found := false f.flagSet.Visit(func(f *flag.Flag) { diff --git a/vendor/github.com/onsi/ginkgo/v2/types/version.go b/vendor/github.com/onsi/ginkgo/v2/types/version.go index 1df09be005..6874270ac2 100644 --- a/vendor/github.com/onsi/ginkgo/v2/types/version.go +++ b/vendor/github.com/onsi/ginkgo/v2/types/version.go @@ -1,3 +1,3 @@ package types -const VERSION = "2.28.1" +const VERSION = "2.28.2" diff --git a/vendor/github.com/onsi/gomega/CHANGELOG.md b/vendor/github.com/onsi/gomega/CHANGELOG.md index 91e65521b4..5f9966fbe7 100644 --- a/vendor/github.com/onsi/gomega/CHANGELOG.md +++ b/vendor/github.com/onsi/gomega/CHANGELOG.md @@ -1,3 +1,21 @@ +## 1.41.0 + +### Features + +Add `BeASlice` and `BeAnArray` matchers + +### Fixes + +Object formatting now detects pointer cycles to avoid runaway formatting output. + +## 1.40.0 + +We're adopting a new release strategy to minimize dependency bloat in projects that consume Gomega. It is a limitation of the go mod toolchain that _test_ subdependencies of your project's direct dependencies get pulled in as *indirect* dependencies. In the case of Gomega, this ends up pulling in all of Ginkgo into your `go.mod` even if you are only using Gomega (Gomega uses Ginkgo for its own tests). + +Going forward, releases will strip out all tests, tidy up the `go.mod` and then push this stripped down version to a new `master-lite` branch. These stripped-down versions will receive the `vx.y.z` git tag and will be picked up by the go toolchain. + +Please open an issue if this new release process causes unexpected changes for your projects. + ## 1.39.1 Update all dependencies. This auto-updated the required version of Go to 1.24, consistent with the fact that Go 1.23 has been out of support for almost six months. diff --git a/vendor/github.com/onsi/gomega/format/format.go b/vendor/github.com/onsi/gomega/format/format.go index 6c23ba338b..d56f9a4753 100644 --- a/vendor/github.com/onsi/gomega/format/format.go +++ b/vendor/github.com/onsi/gomega/format/format.go @@ -262,7 +262,7 @@ func Object(object any, indentation uint) string { if err, ok := object.(error); ok && !isNilValue(value) { // isNilValue check needed here to avoid nil deref due to boxed nil commonRepresentation += "\n" + IndentString(err.Error(), indentation) + "\n" + indent } - return fmt.Sprintf("%s<%s>: %s%s", indent, formatType(value), commonRepresentation, formatValue(value, indentation, true)) + return fmt.Sprintf("%s<%s>: %s%s", indent, formatType(value), commonRepresentation, formatValue(value, indentation, true, map[uintptr]struct{}{})) } /* @@ -306,7 +306,7 @@ func formatType(v reflect.Value) string { } } -func formatValue(value reflect.Value, indentation uint, isTopLevel bool) string { +func formatValue(value reflect.Value, indentation uint, isTopLevel bool, visited map[uintptr]struct{}) string { if indentation > MaxDepth { return "..." } @@ -367,23 +367,28 @@ func formatValue(value reflect.Value, indentation uint, isTopLevel bool) string case reflect.Func: return fmt.Sprintf("0x%x", value.Pointer()) case reflect.Ptr: - return formatValue(value.Elem(), indentation, isTopLevel) + ptr := value.Pointer() + if _, ok := visited[ptr]; ok { + return fmt.Sprintf("0x%x (cyclic reference)", ptr) + } + visited[ptr] = struct{}{} + return formatValue(value.Elem(), indentation, isTopLevel, visited) case reflect.Slice: - return truncateLongStrings(formatSlice(value, indentation)) + return truncateLongStrings(formatSlice(value, indentation, visited)) case reflect.String: return truncateLongStrings(formatString(value.String(), indentation, isTopLevel)) case reflect.Array: - return truncateLongStrings(formatSlice(value, indentation)) + return truncateLongStrings(formatSlice(value, indentation, visited)) case reflect.Map: - return truncateLongStrings(formatMap(value, indentation)) + return truncateLongStrings(formatMap(value, indentation, visited)) case reflect.Struct: if value.Type() == timeType && value.CanInterface() { t, _ := value.Interface().(time.Time) return t.Format(time.RFC3339Nano) } - return truncateLongStrings(formatStruct(value, indentation)) + return truncateLongStrings(formatStruct(value, indentation, visited)) case reflect.Interface: - return formatInterface(value, indentation) + return formatInterface(value, indentation, visited) default: if value.CanInterface() { return truncateLongStrings(fmt.Sprintf("%#v", value.Interface())) @@ -414,7 +419,7 @@ func formatString(object any, indentation uint, isTopLevel bool) string { } } -func formatSlice(v reflect.Value, indentation uint) string { +func formatSlice(v reflect.Value, indentation uint, visited map[uintptr]struct{}) string { if v.Kind() == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 && isPrintableString(string(v.Bytes())) { return formatString(v.Bytes(), indentation, false) } @@ -423,7 +428,7 @@ func formatSlice(v reflect.Value, indentation uint) string { result := make([]string, l) longest := 0 for i := range l { - result[i] = formatValue(v.Index(i), indentation+1, false) + result[i] = formatValue(v.Index(i), indentation+1, false, visited) if len(result[i]) > longest { longest = len(result[i]) } @@ -436,14 +441,14 @@ func formatSlice(v reflect.Value, indentation uint) string { return fmt.Sprintf("[%s]", strings.Join(result, ", ")) } -func formatMap(v reflect.Value, indentation uint) string { +func formatMap(v reflect.Value, indentation uint, visited map[uintptr]struct{}) string { l := v.Len() result := make([]string, l) longest := 0 for i, key := range v.MapKeys() { value := v.MapIndex(key) - result[i] = fmt.Sprintf("%s: %s", formatValue(key, indentation+1, false), formatValue(value, indentation+1, false)) + result[i] = fmt.Sprintf("%s: %s", formatValue(key, indentation+1, false, visited), formatValue(value, indentation+1, false, visited)) if len(result[i]) > longest { longest = len(result[i]) } @@ -456,7 +461,7 @@ func formatMap(v reflect.Value, indentation uint) string { return fmt.Sprintf("{%s}", strings.Join(result, ", ")) } -func formatStruct(v reflect.Value, indentation uint) string { +func formatStruct(v reflect.Value, indentation uint, visited map[uintptr]struct{}) string { t := v.Type() l := v.NumField() @@ -465,7 +470,7 @@ func formatStruct(v reflect.Value, indentation uint) string { for i := range l { structField := t.Field(i) fieldEntry := v.Field(i) - representation := fmt.Sprintf("%s: %s", structField.Name, formatValue(fieldEntry, indentation+1, false)) + representation := fmt.Sprintf("%s: %s", structField.Name, formatValue(fieldEntry, indentation+1, false, visited)) result = append(result, representation) if len(representation) > longest { longest = len(representation) @@ -478,8 +483,8 @@ func formatStruct(v reflect.Value, indentation uint) string { return fmt.Sprintf("{%s}", strings.Join(result, ", ")) } -func formatInterface(v reflect.Value, indentation uint) string { - return fmt.Sprintf("<%s>%s", formatType(v.Elem()), formatValue(v.Elem(), indentation, false)) +func formatInterface(v reflect.Value, indentation uint, visited map[uintptr]struct{}) string { + return fmt.Sprintf("<%s>%s", formatType(v.Elem()), formatValue(v.Elem(), indentation, false, visited)) } func isNilValue(a reflect.Value) bool { diff --git a/vendor/github.com/onsi/gomega/gomega_dsl.go b/vendor/github.com/onsi/gomega/gomega_dsl.go index 87c70692bf..df16ede113 100644 --- a/vendor/github.com/onsi/gomega/gomega_dsl.go +++ b/vendor/github.com/onsi/gomega/gomega_dsl.go @@ -22,7 +22,7 @@ import ( "github.com/onsi/gomega/types" ) -const GOMEGA_VERSION = "1.39.1" +const GOMEGA_VERSION = "1.41.0" const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler. If you're using Ginkgo then you probably forgot to put your assertion in an It(). diff --git a/vendor/github.com/onsi/gomega/matchers.go b/vendor/github.com/onsi/gomega/matchers.go index 16ca8f46dc..bf57226050 100644 --- a/vendor/github.com/onsi/gomega/matchers.go +++ b/vendor/github.com/onsi/gomega/matchers.go @@ -621,6 +621,18 @@ func BeADirectory() types.GomegaMatcher { return &matchers.BeADirectoryMatcher{} } +// BeASlice succeeds if actual is a value of slice type. +// This is useful when actual has type any (interface{}) and you want to assert it is a slice. +func BeASlice() types.GomegaMatcher { + return &matchers.BeASliceMatcher{} +} + +// BeAnArray succeeds if actual is a value of array type. +// This is useful when actual has type any (interface{}) and you want to assert it is an array. +func BeAnArray() types.GomegaMatcher { + return &matchers.BeAnArrayMatcher{} +} + // HaveHTTPStatus succeeds if the Status or StatusCode field of an HTTP response matches. // Actual must be either a *http.Response or *httptest.ResponseRecorder. // Expected must be either an int or a string. diff --git a/vendor/github.com/onsi/gomega/matchers/be_a_slice_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_a_slice_matcher.go new file mode 100644 index 0000000000..4fcad51271 --- /dev/null +++ b/vendor/github.com/onsi/gomega/matchers/be_a_slice_matcher.go @@ -0,0 +1,28 @@ +// untested sections: 1 + +package matchers + +import ( + "fmt" + "reflect" + + "github.com/onsi/gomega/format" +) + +type BeASliceMatcher struct { +} + +func (matcher *BeASliceMatcher) Match(actual any) (success bool, err error) { + if actual == nil { + return false, fmt.Errorf("BeASlice matcher expects a value, got nil") + } + return reflect.TypeOf(actual).Kind() == reflect.Slice, nil +} + +func (matcher *BeASliceMatcher) FailureMessage(actual any) (message string) { + return format.Message(actual, "to be a slice") +} + +func (matcher *BeASliceMatcher) NegatedFailureMessage(actual any) (message string) { + return format.Message(actual, "not to be a slice") +} diff --git a/vendor/github.com/onsi/gomega/matchers/be_an_array_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_an_array_matcher.go new file mode 100644 index 0000000000..573aa81987 --- /dev/null +++ b/vendor/github.com/onsi/gomega/matchers/be_an_array_matcher.go @@ -0,0 +1,28 @@ +// untested sections: 1 + +package matchers + +import ( + "fmt" + "reflect" + + "github.com/onsi/gomega/format" +) + +type BeAnArrayMatcher struct { +} + +func (matcher *BeAnArrayMatcher) Match(actual any) (success bool, err error) { + if actual == nil { + return false, fmt.Errorf("BeAnArray matcher expects a value, got nil") + } + return reflect.TypeOf(actual).Kind() == reflect.Array, nil +} + +func (matcher *BeAnArrayMatcher) FailureMessage(actual any) (message string) { + return format.Message(actual, "to be an array") +} + +func (matcher *BeAnArrayMatcher) NegatedFailureMessage(actual any) (message string) { + return format.Message(actual, "not to be an array") +} diff --git a/vendor/github.com/onsi/gomega/types/types.go b/vendor/github.com/onsi/gomega/types/types.go index 685a46f373..e444451ac6 100644 --- a/vendor/github.com/onsi/gomega/types/types.go +++ b/vendor/github.com/onsi/gomega/types/types.go @@ -66,6 +66,12 @@ func MatchMayChangeInTheFuture(matcher GomegaMatcher, value any) bool { // AsyncAssertions are returned by Eventually and Consistently and enable matchers to be polled repeatedly to ensure // they are eventually satisfied +// +// The optional optionalDescription argument allows you to annotate the assertion with additional information. +// It is passed as the second argument and can be a format string followed by arguments, or a func() string. +// The description is included in failure messages to provide context. +// +// For details on annotating assertions, see: https://onsi.github.io/gomega/#annotating-assertions type AsyncAssertion interface { Should(matcher GomegaMatcher, optionalDescription ...any) bool ShouldNot(matcher GomegaMatcher, optionalDescription ...any) bool @@ -86,6 +92,12 @@ type AsyncAssertion interface { } // Assertions are returned by Ω and Expect and enable assertions against Gomega matchers +// +// The optional optionalDescription argument allows you to annotate the assertion with additional information. +// It is passed as the second argument and can be a format string followed by arguments, or a func() string. +// The description is included in failure messages to provide context. +// +// For details on annotating assertions, see: https://onsi.github.io/gomega/#annotating-assertions type Assertion interface { Should(matcher GomegaMatcher, optionalDescription ...any) bool ShouldNot(matcher GomegaMatcher, optionalDescription ...any) bool diff --git a/vendor/gopkg.in/ini.v1/.golangci.yml b/vendor/gopkg.in/ini.v1/.golangci.yml index fabbdb621e..6937629460 100644 --- a/vendor/gopkg.in/ini.v1/.golangci.yml +++ b/vendor/gopkg.in/ini.v1/.golangci.yml @@ -6,11 +6,6 @@ linters: - unconvert - unparam settings: - govet: - disable: - # printf: non-constant format string in call to fmt.Errorf (govet) - # showing up since golangci-lint version 1.60.1 - - printf nakedret: max-func-lines: 0 # Disallow any unnamed return statement exclusions: diff --git a/vendor/gopkg.in/ini.v1/data_source.go b/vendor/gopkg.in/ini.v1/data_source.go index c3a541f1d1..6e2572b72f 100644 --- a/vendor/gopkg.in/ini.v1/data_source.go +++ b/vendor/gopkg.in/ini.v1/data_source.go @@ -18,7 +18,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "os" ) @@ -48,7 +47,7 @@ type sourceData struct { } func (s *sourceData) ReadCloser() (io.ReadCloser, error) { - return ioutil.NopCloser(bytes.NewReader(s.data)), nil + return io.NopCloser(bytes.NewReader(s.data)), nil } // sourceReadCloser represents an input stream with Close method. @@ -69,7 +68,7 @@ func parseDataSource(source interface{}) (dataSource, error) { case io.ReadCloser: return &sourceReadCloser{s}, nil case io.Reader: - return &sourceReadCloser{ioutil.NopCloser(s)}, nil + return &sourceReadCloser{io.NopCloser(s)}, nil default: return nil, fmt.Errorf("error parsing data source: unknown type %q", s) } diff --git a/vendor/gopkg.in/ini.v1/file.go b/vendor/gopkg.in/ini.v1/file.go index f8b22408be..58beabc2f0 100644 --- a/vendor/gopkg.in/ini.v1/file.go +++ b/vendor/gopkg.in/ini.v1/file.go @@ -19,7 +19,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "strings" "sync" @@ -532,7 +531,7 @@ func (f *File) SaveToIndent(filename, indent string) error { return err } - return ioutil.WriteFile(filename, buf.Bytes(), 0666) + return os.WriteFile(filename, buf.Bytes(), 0666) } // SaveTo writes content to file system. diff --git a/vendor/gopkg.in/ini.v1/key.go b/vendor/gopkg.in/ini.v1/key.go index 1a7767a2e6..b1ef5c96d7 100644 --- a/vendor/gopkg.in/ini.v1/key.go +++ b/vendor/gopkg.in/ini.v1/key.go @@ -170,7 +170,7 @@ func (k *Key) transformValue(val string) string { } // Substitute by new value and take off leading '%(' and trailing ')s'. - val = strings.ReplaceAll(val, vr, nk.value) + val = strings.ReplaceAll(val, vr, nk.String()) } return val } diff --git a/vendor/gopkg.in/ini.v1/struct.go b/vendor/gopkg.in/ini.v1/struct.go index a486b2fe0f..819a6e5a64 100644 --- a/vendor/gopkg.in/ini.v1/struct.go +++ b/vendor/gopkg.in/ini.v1/struct.go @@ -156,7 +156,7 @@ func wrapStrictError(err error, isStrict bool) error { // because we want to use default value that is already assigned to struct. func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string, allowShadow, isStrict bool) error { vt := t - isPtr := t.Kind() == reflect.Ptr + isPtr := t.Kind() == reflect.Pointer if isPtr { vt = t.Elem() } @@ -278,7 +278,7 @@ func parseTagOptions(tag string) (rawName string, omitEmpty bool, allowShadow bo // mapToField maps the given value to the matching field of the given section. // The sectionIndex is the index (if non unique sections are enabled) to which the value should be added. func (s *Section) mapToField(val reflect.Value, isStrict bool, sectionIndex int, sectionName string) error { - if val.Kind() == reflect.Ptr { + if val.Kind() == reflect.Pointer { val = val.Elem() } typ := val.Type() @@ -299,8 +299,8 @@ func (s *Section) mapToField(val reflect.Value, isStrict bool, sectionIndex int, } isStruct := tpField.Type.Kind() == reflect.Struct - isStructPtr := tpField.Type.Kind() == reflect.Ptr && tpField.Type.Elem().Kind() == reflect.Struct - isAnonymousPtr := tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous + isStructPtr := tpField.Type.Kind() == reflect.Pointer && tpField.Type.Elem().Kind() == reflect.Struct + isAnonymousPtr := tpField.Type.Kind() == reflect.Pointer && tpField.Anonymous if isAnonymousPtr { field.Set(reflect.New(tpField.Type.Elem())) } @@ -381,7 +381,7 @@ func (s *Section) mapToSlice(secName string, val reflect.Value, isStrict bool) ( func (s *Section) mapTo(v interface{}, isStrict bool) error { typ := reflect.TypeOf(v) val := reflect.ValueOf(v) - if typ.Kind() == reflect.Ptr { + if typ.Kind() == reflect.Pointer { typ = typ.Elem() val = val.Elem() } else { @@ -500,13 +500,13 @@ func reflectSliceWithProperType(key *Key, field reflect.Value, delim string, all case reflect.String: buf.WriteString(slice.Index(i).String()) case reflect.Int, reflect.Int64: - buf.WriteString(fmt.Sprint(slice.Index(i).Int())) + fmt.Fprint(&buf, slice.Index(i).Int()) case reflect.Uint, reflect.Uint64: - buf.WriteString(fmt.Sprint(slice.Index(i).Uint())) + fmt.Fprint(&buf, slice.Index(i).Uint()) case reflect.Float64: - buf.WriteString(fmt.Sprint(slice.Index(i).Float())) + fmt.Fprint(&buf, slice.Index(i).Float()) case reflect.Bool: - buf.WriteString(fmt.Sprint(slice.Index(i).Bool())) + fmt.Fprint(&buf, slice.Index(i).Bool()) case reflectTime: buf.WriteString(slice.Index(i).Interface().(time.Time).Format(time.RFC3339)) default: @@ -535,7 +535,7 @@ func reflectWithProperType(t reflect.Type, key *Key, field reflect.Value, delim key.SetValue(fmt.Sprint(field.Interface().(time.Time).Format(time.RFC3339))) case reflect.Slice: return reflectSliceWithProperType(key, field, delim, allowShadow) - case reflect.Ptr: + case reflect.Pointer: if !field.IsNil() { return reflectWithProperType(t.Elem(), key, field.Elem(), delim, allowShadow) } @@ -559,7 +559,7 @@ func isEmptyValue(v reflect.Value) bool { return v.Uint() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 - case reflect.Interface, reflect.Ptr: + case reflect.Interface, reflect.Pointer: return v.IsNil() case reflectTime: t, ok := v.Interface().(time.Time) @@ -574,7 +574,7 @@ type StructReflector interface { } func (s *Section) reflectFrom(val reflect.Value) error { - if val.Kind() == reflect.Ptr { + if val.Kind() == reflect.Pointer { val = val.Elem() } typ := val.Type() @@ -606,14 +606,14 @@ func (s *Section) reflectFrom(val reflect.Value) error { continue } - if extends && tpField.Anonymous && (tpField.Type.Kind() == reflect.Ptr || tpField.Type.Kind() == reflect.Struct) { + if extends && tpField.Anonymous && (tpField.Type.Kind() == reflect.Pointer || tpField.Type.Kind() == reflect.Struct) { if err := s.reflectFrom(field); err != nil { return fmt.Errorf("reflect from field %q: %v", fieldName, err) } continue } - if (tpField.Type.Kind() == reflect.Ptr && tpField.Type.Elem().Kind() == reflect.Struct) || + if (tpField.Type.Kind() == reflect.Pointer && tpField.Type.Elem().Kind() == reflect.Struct) || (tpField.Type.Kind() == reflect.Struct && tpField.Type.Name() != "Time") { // Note: The only error here is section doesn't exist. sec, err := s.f.GetSection(fieldName) @@ -641,7 +641,7 @@ func (s *Section) reflectFrom(val reflect.Value) error { sliceOf := field.Type().Elem().Kind() for i := 0; i < field.Len(); i++ { - if sliceOf != reflect.Struct && sliceOf != reflect.Ptr { + if sliceOf != reflect.Struct && sliceOf != reflect.Pointer { return fmt.Errorf("field %q is not a slice of pointer or struct", fieldName) } @@ -688,11 +688,11 @@ func (s *Section) ReflectFrom(v interface{}) error { val := reflect.ValueOf(v) if s.name != DefaultSection && s.f.options.AllowNonUniqueSections && - (typ.Kind() == reflect.Slice || typ.Kind() == reflect.Ptr) { + (typ.Kind() == reflect.Slice || typ.Kind() == reflect.Pointer) { // Clear sections to make sure none exists before adding the new ones s.f.DeleteSection(s.name) - if typ.Kind() == reflect.Ptr { + if typ.Kind() == reflect.Pointer { sec, err := s.f.NewSection(s.name) if err != nil { return err @@ -702,7 +702,7 @@ func (s *Section) ReflectFrom(v interface{}) error { slice := val.Slice(0, val.Len()) sliceOf := val.Type().Elem().Kind() - if sliceOf != reflect.Ptr { + if sliceOf != reflect.Pointer { return fmt.Errorf("not a slice of pointers") } @@ -721,7 +721,7 @@ func (s *Section) ReflectFrom(v interface{}) error { return nil } - if typ.Kind() == reflect.Ptr { + if typ.Kind() == reflect.Pointer { val = val.Elem() } else { return errors.New("not a pointer to a struct") diff --git a/vendor/modules.txt b/vendor/modules.txt index aec89aed72..331a31ec57 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -386,7 +386,7 @@ github.com/olekukonko/tablewriter/pkg/twwarp github.com/olekukonko/tablewriter/pkg/twwidth github.com/olekukonko/tablewriter/renderer github.com/olekukonko/tablewriter/tw -# github.com/onsi/ginkgo/v2 v2.28.1 +# github.com/onsi/ginkgo/v2 v2.28.2 ## explicit; go 1.24.0 github.com/onsi/ginkgo/v2 github.com/onsi/ginkgo/v2/config @@ -410,7 +410,7 @@ github.com/onsi/ginkgo/v2/internal/reporters github.com/onsi/ginkgo/v2/internal/testingtproxy github.com/onsi/ginkgo/v2/reporters github.com/onsi/ginkgo/v2/types -# github.com/onsi/gomega v1.39.1 +# github.com/onsi/gomega v1.41.0 ## explicit; go 1.24.0 github.com/onsi/gomega github.com/onsi/gomega/format @@ -860,13 +860,13 @@ gopkg.in/evanphx/json-patch.v4 # gopkg.in/inf.v0 v0.9.1 ## explicit gopkg.in/inf.v0 -# gopkg.in/ini.v1 v1.67.1 +# gopkg.in/ini.v1 v1.67.2 ## explicit; go 1.13 gopkg.in/ini.v1 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.34.7 +# k8s.io/api v0.34.8 ## explicit; go 1.24.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -928,7 +928,7 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apiextensions-apiserver v0.34.7 +# k8s.io/apiextensions-apiserver v0.34.8 ## explicit; go 1.24.0 k8s.io/apiextensions-apiserver/pkg/apihelpers k8s.io/apiextensions-apiserver/pkg/apis/apiextensions @@ -949,7 +949,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/features -# k8s.io/apimachinery v0.34.7 +# k8s.io/apimachinery v0.34.8 ## explicit; go 1.24.0 k8s.io/apimachinery/pkg/api/apitesting k8s.io/apimachinery/pkg/api/apitesting/fuzzer @@ -1021,7 +1021,7 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.34.7 +# k8s.io/apiserver v0.34.8 ## explicit; go 1.24.0 k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/apis/apiserver @@ -1086,7 +1086,7 @@ k8s.io/apiserver/pkg/warning k8s.io/apiserver/plugin/pkg/authenticator/token/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics -# k8s.io/client-go v0.34.7 +# k8s.io/client-go v0.34.8 ## explicit; go 1.24.0 k8s.io/client-go/applyconfigurations k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -1369,7 +1369,7 @@ k8s.io/client-go/util/workqueue ## explicit; go 1.24.0 k8s.io/cluster-bootstrap/token/api k8s.io/cluster-bootstrap/token/util -# k8s.io/code-generator v0.34.7 +# k8s.io/code-generator v0.34.8 ## explicit; go 1.24.0 k8s.io/code-generator k8s.io/code-generator/cmd/applyconfiguration-gen @@ -1405,7 +1405,7 @@ k8s.io/code-generator/cmd/register-gen/generators k8s.io/code-generator/pkg/namer k8s.io/code-generator/pkg/util k8s.io/code-generator/third_party/forked/golang/reflect -# k8s.io/component-base v0.34.7 +# k8s.io/component-base v0.34.8 ## explicit; go 1.24.0 k8s.io/component-base/cli/flag k8s.io/component-base/compatibility @@ -1490,7 +1490,7 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/cluster-api v1.12.7 +# sigs.k8s.io/cluster-api v1.12.8 ## explicit; go 1.24.0 sigs.k8s.io/cluster-api/api/addons/v1beta2 sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta2 @@ -1570,7 +1570,7 @@ sigs.k8s.io/cluster-api/util/topology sigs.k8s.io/cluster-api/util/version sigs.k8s.io/cluster-api/util/yaml sigs.k8s.io/cluster-api/version -# sigs.k8s.io/cluster-api/test v1.12.7 +# sigs.k8s.io/cluster-api/test v1.12.8 ## explicit; go 1.24.0 sigs.k8s.io/cluster-api/test/e2e sigs.k8s.io/cluster-api/test/e2e/internal/log