diff --git a/.github/workflows/atlas-image-build.yaml b/.github/workflows/atlas-image-build.yaml index e1f2ed1b83..beb1cded75 100644 --- a/.github/workflows/atlas-image-build.yaml +++ b/.github/workflows/atlas-image-build.yaml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - - uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c # v45.0.2 + - uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45.0.3 name: Get changed files id: changed-files with: diff --git a/.github/workflows/dependendy-review.yml b/.github/workflows/dependendy-review.yml index 1bbf4279c4..16cd0a1235 100644 --- a/.github/workflows/dependendy-review.yml +++ b/.github/workflows/dependendy-review.yml @@ -18,4 +18,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: 'Dependency Review' - uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4 + uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0 diff --git a/.github/workflows/images-vulnerability-scanning.yaml b/.github/workflows/images-vulnerability-scanning.yaml index 3a60d7c10b..2c2f2f5883 100644 --- a/.github/workflows/images-vulnerability-scanning.yaml +++ b/.github/workflows/images-vulnerability-scanning.yaml @@ -46,7 +46,7 @@ jobs: - name: Printing Image Path run: echo "image_path=${{env.image_registry}}/${{matrix.images}}:${{env.image_tag}}" >> "$GITHUB_ENV" - name: Running vulnerability scanner - uses: anchore/scan-action@64a33b277ea7a1215a3c142735a1091341939ff5 # v4.1.2 + uses: anchore/scan-action@f2ba85e044c8f5e5014c9a539328a9c78d3bfa49 # v5.2.1 id: vulnerability-scanning with: image: ${{env.image_path}} diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml index 2c13c6b328..e8a848426f 100644 --- a/.github/workflows/ossf-scorecard.yml +++ b/.github/workflows/ossf-scorecard.yml @@ -39,12 +39,12 @@ jobs: - # Upload the results to GitHub's code scanning dashboard. name: "Upload to results to dashboard" - uses: github/codeql-action/upload-sarif@6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea # v3.26.11 + uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 with: sarif_file: results.sarif - name: "Upload analysis results as 'Job Artifact'" - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: SARIF file path: results.sarif diff --git a/build/codegen.sh b/build/codegen.sh index de6466f44f..b552e55c8d 100755 --- a/build/codegen.sh +++ b/build/codegen.sh @@ -23,12 +23,21 @@ set -o xtrace export GO111MODULE=on go mod download execDir="/go/pkg/mod/k8s.io/code-generator@$(go list -f '{{.Version}}' -m k8s.io/code-generator)" -chmod +x "${execDir}"/generate-groups.sh -chmod +x "${execDir}"/generate-internal-groups.sh -"${execDir}"/generate-groups.sh \ - all \ - github.com/kanisterio/kanister/pkg/client \ - github.com/kanisterio/kanister/pkg/apis \ - "cr:v1alpha1" \ - --go-header-file "$PWD"/build/boilerplate.go.txt \ - -o /go/src/ +boilerplateFile="$(pwd)"/build/boilerplate.go.txt + +source "${execDir}"/kube_codegen.sh + +kube::codegen::gen_helpers \ +--boilerplate "${boilerplateFile}" \ +--extra-peer-dir ./pkg/client \ +--extra-peer-dir ./pkg/apis \ +go/src/ + +kube::codegen::gen_client \ +--with-applyconfig \ +--with-watch \ +--boilerplate "${boilerplateFile}" \ +--output-dir ./pkg/client \ +--output-pkg github.com/kanisterio/kanister/pkg/client \ +./pkg/apis + diff --git a/docker/controller/Dockerfile b/docker/controller/Dockerfile index 6f6f92028c..a4cd3358df 100644 --- a/docker/controller/Dockerfile +++ b/docker/controller/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227.1726694542 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 LABEL maintainer="Tom Manville" diff --git a/docker/postgres-kanister-tools/requirements.txt b/docker/postgres-kanister-tools/requirements.txt index 8ac3cf4570..e1e713f440 100644 --- a/docker/postgres-kanister-tools/requirements.txt +++ b/docker/postgres-kanister-tools/requirements.txt @@ -1,4 +1,4 @@ -awscli==1.35.11 -pip==24.2 -setuptools==75.2.0 -wheel==0.44.0 +awscli==1.36.10 +pip==24.3.1 +setuptools==75.6.0 +wheel==0.45.1 diff --git a/docker/postgresql/requirements.txt b/docker/postgresql/requirements.txt index 3a25e69aca..fdc1cfa954 100644 --- a/docker/postgresql/requirements.txt +++ b/docker/postgresql/requirements.txt @@ -1,5 +1,5 @@ -awscli==1.35.11 +awscli==1.36.10 wal-e==1.1.1 -pip==24.2 -setuptools==75.2.0 -wheel==0.44.0 +pip==24.3.1 +setuptools==75.6.0 +wheel==0.45.1 diff --git a/docker/repo-server-controller/Dockerfile b/docker/repo-server-controller/Dockerfile index 92d19cfdec..610d3fff93 100644 --- a/docker/repo-server-controller/Dockerfile +++ b/docker/repo-server-controller/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227.1726694542 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 LABEL maintainer="Tom Manville" diff --git a/docker/tools/Dockerfile b/docker/tools/Dockerfile index 2fde61b1f7..e067d78785 100644 --- a/docker/tools/Dockerfile +++ b/docker/tools/Dockerfile @@ -74,7 +74,7 @@ RUN apt-get update && apt-get -y install ca-certificates && \ USER kopia:kopia # Build tools image -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227.1726694542 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 ARG kan_tools_version="test-version" LABEL name="kanister-tools" \ vendor="Kanister" \ diff --git a/go.mod b/go.mod index ee2f7f3eeb..5b7a622578 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/jpillora/backoff v1.0.0 github.com/json-iterator/go v1.1.12 github.com/kanisterio/errkit v0.0.2 - github.com/kanisterio/safecli v0.0.8 + github.com/kanisterio/safecli v0.0.9 github.com/kopia/kopia v0.17.1-0.20240927044625-1bceb7155ede github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 github.com/lib/pq v1.10.9 @@ -48,31 +48,31 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.1 go.uber.org/zap v1.27.0 - golang.org/x/oauth2 v0.23.0 + golang.org/x/oauth2 v0.24.0 gonum.org/v1/gonum v0.15.1 - google.golang.org/api v0.203.0 + google.golang.org/api v0.209.0 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 - //pinned k8s.io to v0.29.x tag - k8s.io/api v0.29.10 - k8s.io/apiextensions-apiserver v0.29.10 - k8s.io/apimachinery v0.29.10 - k8s.io/cli-runtime v0.29.10 - k8s.io/client-go v0.29.10 - k8s.io/code-generator v0.29.10 - k8s.io/kubectl v0.29.10 - sigs.k8s.io/controller-runtime v0.16.6 + //pinned k8s.io to v0.30.x tag + k8s.io/api v0.30.6 + k8s.io/apiextensions-apiserver v0.30.6 + k8s.io/apimachinery v0.30.6 + k8s.io/cli-runtime v0.30.6 + k8s.io/client-go v0.30.6 + k8s.io/code-generator v0.30.6 + k8s.io/kubectl v0.30.6 + sigs.k8s.io/controller-runtime v0.18.5 sigs.k8s.io/yaml v1.3.0 ) require ( cloud.google.com/go v0.116.0 // indirect - cloud.google.com/go/auth v0.9.9 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect + cloud.google.com/go/auth v0.10.2 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect cloud.google.com/go/compute/metadata v0.5.2 // indirect - cloud.google.com/go/iam v1.2.1 // indirect + cloud.google.com/go/iam v1.2.2 // indirect cloud.google.com/go/storage v1.43.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 // indirect; indirect; @@ -102,7 +102,7 @@ require ( github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect github.com/fatih/color v1.17.0 // indirect github.com/felixge/fgprof v0.9.4 // indirect @@ -111,7 +111,7 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-logr/zapr v1.2.4 // indirect + github.com/go-logr/zapr v1.3.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/errors v0.22.0 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect @@ -121,7 +121,7 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -135,7 +135,7 @@ require ( github.com/google/s2a-go v0.1.8 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.13.0 // indirect + github.com/googleapis/gax-go/v2 v2.14.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect @@ -204,30 +204,30 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.starlark.net v0.0.0-20240314022150-ee8ed142361c // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.28.0 // indirect + golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.30.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/term v0.25.0 // indirect - golang.org/x/text v0.19.0 // indirect - golang.org/x/time v0.7.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/term v0.26.0 // indirect + golang.org/x/text v0.20.0 // indirect + golang.org/x/time v0.8.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect - google.golang.org/grpc v1.67.1 - google.golang.org/protobuf v1.35.1 + google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect + google.golang.org/grpc v1.68.0 + google.golang.org/protobuf v1.35.2 gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/kothar/go-backblaze.v0 v0.0.0-20210124194846-35409b867216 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/component-base v0.29.10 // indirect - k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect - k8s.io/klog/v2 v2.110.1 // indirect - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 + k8s.io/component-base v0.30.6 // indirect + k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect diff --git a/go.sum b/go.sum index fb685a524e..69632e6267 100644 --- a/go.sum +++ b/go.sum @@ -8,18 +8,18 @@ cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= -cloud.google.com/go/auth v0.9.9 h1:BmtbpNQozo8ZwW2t7QJjnrQtdganSdmqeIBxHxNkEZQ= -cloud.google.com/go/auth v0.9.9/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= -cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= -cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/auth v0.10.2 h1:oKF7rgBfSHdp/kuhXtqU/tNDr0mZqhYbEh+6SiqzkKo= +cloud.google.com/go/auth v0.10.2/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= +cloud.google.com/go/auth/oauth2adapt v0.2.5 h1:2p29+dePqsCHPP1bqDJcKj4qxRyYCcbzKpFyKGt3MTk= +cloud.google.com/go/auth/oauth2adapt v0.2.5/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/iam v1.2.1 h1:QFct02HRb7H12J/3utj0qf5tobFh9V4vR6h9eX5EBRU= -cloud.google.com/go/iam v1.2.1/go.mod h1:3VUIJDPpwT6p/amXRC5GY8fCCh70lxPygguVtI0Z4/g= -cloud.google.com/go/longrunning v0.6.1 h1:lOLTFxYpr8hcRtcwWir5ITh1PAKUD/sG2lKrTSYjyMc= -cloud.google.com/go/longrunning v0.6.1/go.mod h1:nHISoOZpBcmlwbJmiVk5oDRz0qG/ZxPynEGs1iZ79s0= +cloud.google.com/go/iam v1.2.2 h1:ozUSofHUGf/F4tCNy/mu9tHLTaxZFLOUiKzjcgWHGIA= +cloud.google.com/go/iam v1.2.2/go.mod h1:0Ys8ccaZHdI1dEUilwzqng/6ps2YB6vRsjIe00/+6JY= +cloud.google.com/go/longrunning v0.6.2 h1:xjDfh1pQcWPEvnfjZmwjKQEcHnpz6lHjfy7Fo0MK+hc= +cloud.google.com/go/longrunning v0.6.2/go.mod h1:k/vIs83RN4bE3YCswdXC5PFfWVILjm3hpEUlSko4PiI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= @@ -115,7 +115,6 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= @@ -177,8 +176,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= @@ -205,14 +204,12 @@ github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3I github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= -github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-openapi/errors v0.22.0 h1:c4xY/OLxUBSTiepAg3j/MHuAv5mJhnf53LLMWFB+u/w= @@ -255,8 +252,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= +github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -331,8 +328,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gT github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= -github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= +github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= +github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= @@ -362,7 +359,6 @@ github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -379,8 +375,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kanisterio/errkit v0.0.2 h1:3v3HGz9lHIbZR6Jr9qIJpRjaqUX0rsJSLMEQGsMHiUk= github.com/kanisterio/errkit v0.0.2/go.mod h1:ViQ6kPJ2gTJDEvRytmwde7pzG9/sndObF9BPZoEZixc= -github.com/kanisterio/safecli v0.0.8 h1:flvTiGksy/a0+zvqjaBSJwxESu/nFcG65yttmR0XwiA= -github.com/kanisterio/safecli v0.0.8/go.mod h1:KBraqj8mdv2cwAr9wecknGUb8jztTzUik0r7uE6yRA8= +github.com/kanisterio/safecli v0.0.9 h1:MBjXbS82fWhGUaOX1MP+xGyTcouh1GRzzu4EzqQV0rY= +github.com/kanisterio/safecli v0.0.9/go.mod h1:y1oYVoT2eqsmySCIS5yOzrxaYVywlMSEdWEKfLhBjgs= github.com/kastenhq/check v0.0.0-20180626002341-0264cfcea734 h1:qulsCaCv+O2y9/sQ9nd5KChnAgFOWakTHQ9ZADjs6DQ= github.com/kastenhq/check v0.0.0-20180626002341-0264cfcea734/go.mod h1:rdqSnvOJuKCPFW/h2rVLuXOAkRnHHdp9PZcKx4HCoDM= github.com/kastenhq/stow v0.2.6-kasten.1.0.20231101232131-9321daa23aae h1:2cl4yuAJpdmLCx7G8eIsfNlQBLEfw0JDj6mTTyqc5qg= @@ -477,12 +473,12 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/openshift/api v0.0.0-20231222123017-053aee22b4b4 h1:XHl52N6/q+aE5qvmN3YyHyV2H0xepZTbr/r6Vs5pNjo= github.com/openshift/api v0.0.0-20231222123017-053aee22b4b4/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4= github.com/openshift/client-go v0.0.0-20231221125933-2aa81c72f992 h1:JQ/w7ublPBrPRwknrde4apbTR23PDxKYUmkkfo1Nvws= @@ -494,7 +490,6 @@ github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9F github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= @@ -595,14 +590,10 @@ go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeX go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.starlark.net v0.0.0-20240314022150-ee8ed142361c h1:roAjH18hZcwI4hHStHbkXjF5b7UUyZ/0SG3hXNN1SjA= go.starlark.net v0.0.0-20240314022150-ee8ed142361c/go.mod h1:YKMCv9b1WrfWmeqdV5MAuEHWsu5iC+fe6kYl2sQjdI8= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -617,8 +608,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -634,7 +625,6 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -655,8 +645,8 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -668,8 +658,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -698,13 +688,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= -golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= +golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= +golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -713,14 +703,14 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= -golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -742,12 +732,10 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= @@ -765,8 +753,8 @@ google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.203.0 h1:SrEeuwU3S11Wlscsn+LA1kb/Y5xT8uggJSkIhD08NAU= -google.golang.org/api v0.203.0/go.mod h1:BuOVyCSYEPwJb3npWvDnNmFI92f3GeRnHNkETneT3SI= +google.golang.org/api v0.209.0 h1:Ja2OXNlyRlWCWu8o+GgI4yUn/wz9h/5ZfFbKz+dQX+w= +google.golang.org/api v0.209.0/go.mod h1:I53S168Yr/PNDNMi5yPnDc0/LGRZO6o7PoEbl/HY3CM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -782,12 +770,12 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 h1:Df6WuGvthPzc+JiQ/G+m+sNX24kc0aTBqoDN/0yyykE= -google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53/go.mod h1:fheguH3Am2dGp1LfXkrvwqC/KlFq8F0nLq3LryOMrrE= -google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg= -google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f h1:zDoHYmMzMacIdjNe+P2XiTmPsLawi/pCbSPfxt6lTfw= +google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f/go.mod h1:Q5m6g8b5KaFFzsQFIGdJkSJDGeJiybVenoYFMMa3ohI= +google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= +google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -796,8 +784,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -808,8 +796,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= -google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -834,42 +822,42 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= -k8s.io/api v0.29.10 h1:Fao3HOxccbGRC1HZtXD+Y41xJhP0tEToVo5W7EEUBm0= -k8s.io/api v0.29.10/go.mod h1:rF0sRh64w1hMNAVGh4YYniSxODyHye3GLmymAbWBDvY= -k8s.io/apiextensions-apiserver v0.29.10 h1:2k2AHrWgs4S+07HrOjEdcyrQ/UqYlvBi6uon1fox1KE= -k8s.io/apiextensions-apiserver v0.29.10/go.mod h1:3rrJC52bW5frHf10N3JvaDpl++hgrzD9Gs6IZpKWMoc= +k8s.io/api v0.30.6 h1:uqRDLnFkmPLorI9D0x1dGXdYeRQMhQHlrHDgZ3/45RE= +k8s.io/api v0.30.6/go.mod h1:6x759Hj7155pXRKStxzM7TMN9hW0x7WrBr51kuDMSHo= +k8s.io/apiextensions-apiserver v0.30.6 h1:eXmd0cki9xjpUguN7zaWI8I6wo1utHQj6RWqeBaVmew= +k8s.io/apiextensions-apiserver v0.30.6/go.mod h1:va7pN44YJJDHrShKhPSL9S5CyTJ8idAmqIARt5wY4j8= k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/apimachinery v0.29.10 h1:57OLNqOJUgp5KlRRY3JOBFOTTa5Rt/LVkmKiiN2cvaQ= -k8s.io/apimachinery v0.29.10/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= -k8s.io/cli-runtime v0.29.10 h1:iX8bo6jmxvmoq046YX/Ry+s3Vc21sfxmYzjKLfEaP6M= -k8s.io/cli-runtime v0.29.10/go.mod h1:sGE4CX6FM600SEX8h/tPS0WGFYkTH+W5oU9eyp5Xtpc= +k8s.io/apimachinery v0.30.6 h1:dlplzGrUL/DiPOVVVjDcT9ZoQBOwYeB6hcFy90veggs= +k8s.io/apimachinery v0.30.6/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/cli-runtime v0.30.6 h1:vH7E+QSwR6Q/jHC0Etoal6tDGECWQDm5nw3YdzZZuVs= +k8s.io/cli-runtime v0.30.6/go.mod h1:aWY1dJ9IB5pysp4tU2x70zpHlckMbCMVcHYopjVPSWw= k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= -k8s.io/client-go v0.29.10 h1:hPmG1pmKslRhmCIzVd90sA58B0sJwNwduNgXFWsFqhI= -k8s.io/client-go v0.29.10/go.mod h1:gnMCQiRXGL9K0VtlW8gTkhzptGrHm2BJ4qBbujNemc4= +k8s.io/client-go v0.30.6 h1:hMo7AUkHy/UqnwPMH+oJvFR9gpvXVfQnsiO+G2fdE30= +k8s.io/client-go v0.30.6/go.mod h1:DDN89/30A1DfatO+c3ksYMM12kL7a/CZvsBaVjwh33g= k8s.io/code-generator v0.19.0/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= -k8s.io/code-generator v0.29.10 h1:Tj2comS0HYcs9yTt/g5PtiSxnprR7W/3oHLrarmWU5c= -k8s.io/code-generator v0.29.10/go.mod h1:7TYnI0dYItL2cKuhhgPSuF3WED9uMdELgbVXFfn/joE= -k8s.io/component-base v0.29.10 h1:YQrQ/bpzGPGqIPEPaBzxjH0/1DJOI+yZPZNbbz7ZCBY= -k8s.io/component-base v0.29.10/go.mod h1:IbwsBob2DnYiAONsSHIuYenchqcDycbHSLHrXshuLgM= +k8s.io/code-generator v0.30.6 h1:P0pDCNLfT5lxrY6kZ07WtdIHc7a5cZCiJYz1B3MRbu8= +k8s.io/code-generator v0.30.6/go.mod h1:Sg5PSxoHkTD7iFp+gM4d1XvCFCvrMkEa9uoHnCbyfwE= +k8s.io/component-base v0.30.6 h1:t94cw6cQ7bplaS3Y5C/txkUXpaxG+wbgspTmudGUpNs= +k8s.io/component-base v0.30.6/go.mod h1:GAemfIPE9Zc3bxOmeLPpHKKHzfuMlmTwsAjx/bWaJvQ= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= -k8s.io/kubectl v0.29.10 h1:9LLAI52kRG98Kicn+JUPY3ZVg8MPcJVsHPoaMM//9cA= -k8s.io/kubectl v0.29.10/go.mod h1:HxsflBafbaRcMyQjiD6elLHr+erlGmnQgLzSDYjEth0= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/kubectl v0.30.6 h1:yPBMSJJxJk3ZHbiSAZreptXp0CiDVFLeLDXDGH7TyM0= +k8s.io/kubectl v0.30.6/go.mod h1:MHos6OafyfyoFaoSawxQh1uPVc3xXs+v98FGF8Mz0/0= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -sigs.k8s.io/controller-runtime v0.16.6 h1:FiXwTuFF5ZJKmozfP2Z0j7dh6kmxP4Ou1KLfxgKKC3I= -sigs.k8s.io/controller-runtime v0.16.6/go.mod h1:+dQzkZxnylD0u49e0a+7AR+vlibEBaThmPca7lTyUsI= +sigs.k8s.io/controller-runtime v0.18.5 h1:nTHio/W+Q4aBlQMgbnC5hZb4IjIidyrizMai9P6n4Rk= +sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= diff --git a/pkg/apis/cr/v1alpha1/repositoryserver_types_test.go b/pkg/apis/cr/v1alpha1/repositoryserver_types_test.go index 0e051742f1..524d8328c5 100644 --- a/pkg/apis/cr/v1alpha1/repositoryserver_types_test.go +++ b/pkg/apis/cr/v1alpha1/repositoryserver_types_test.go @@ -17,7 +17,7 @@ package v1alpha1 import ( "testing" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" @@ -86,7 +86,7 @@ func getRepositoryServerFromSpec(spec []byte) (*RepositoryServer, error) { repositoryServer := &RepositoryServer{} d := serializer.NewCodecFactory(runtime.NewScheme()).UniversalDeserializer() if _, _, err := d.Decode([]byte(spec), nil, repositoryServer); err != nil { - return nil, errors.Wrap(err, "Failed to decode RepositoryServer") + return nil, errkit.Wrap(err, "Failed to decode RepositoryServer") } return repositoryServer, nil } diff --git a/pkg/apis/cr/v1alpha1/types_test.go b/pkg/apis/cr/v1alpha1/types_test.go index 6da1bc3d7d..6518183101 100644 --- a/pkg/apis/cr/v1alpha1/types_test.go +++ b/pkg/apis/cr/v1alpha1/types_test.go @@ -18,7 +18,7 @@ import ( "reflect" "testing" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" @@ -73,7 +73,7 @@ func getBlueprintFromSpec(spec []byte) (*Blueprint, error) { blueprint := &Blueprint{} d := serializer.NewCodecFactory(runtime.NewScheme()).UniversalDeserializer() if _, _, err := d.Decode([]byte(spec), nil, blueprint); err != nil { - return nil, errors.Wrap(err, "Failed to decode spec into object") + return nil, errkit.Wrap(err, "Failed to decode spec into object") } return blueprint, nil } diff --git a/pkg/blockstorage/azure/azuredisk.go b/pkg/blockstorage/azure/azuredisk.go index 24ffe5cb09..e67d6ef07a 100644 --- a/pkg/blockstorage/azure/azuredisk.go +++ b/pkg/blockstorage/azure/azuredisk.go @@ -549,12 +549,12 @@ func (s *AdStorage) SnapshotsList(ctx context.Context, tags map[string]string) ( return nil, errkit.Wrap(err, "SnapshotsClient.List in SnapshotsList") } for _, snap := range page.Value { - k10Snap, err := s.SnapshotParse(ctx, *snap) + parsedSnap, err := s.SnapshotParse(ctx, *snap) if err != nil { log.WithError(err).Print("Incorrect Snaphost type", field.M{"SnapshotID": snap.ID}) continue } - snaps = append(snaps, k10Snap) + snaps = append(snaps, parsedSnap) } } snaps = blockstorage.FilterSnapshotsWithTags(snaps, blockstorage.SanitizeTags(tags)) diff --git a/pkg/blockstorage/tags/tags.go b/pkg/blockstorage/tags/tags.go index ae99e2eec0..95dbb3faea 100644 --- a/pkg/blockstorage/tags/tags.go +++ b/pkg/blockstorage/tags/tags.go @@ -27,7 +27,7 @@ import ( const ( // ClusterTagKey is used to tag resources with the cluster name ClusterTagKey = "kanister.io/clustername" - // VersionTagKey is used to tag resources with the K10 version + // VersionTagKey is used to tag resources with a version VersionTagKey = "kanister.io/version" // AppNameTag is used to tag volumes with the app they belong to AppNameTag = "kanister.io/appname" diff --git a/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go index 7064fc0dd4..ca6e8420a4 100644 --- a/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go +++ b/pkg/client/applyconfiguration/cr/v1alpha1/repositoryserverstatus.go @@ -19,13 +19,13 @@ package v1alpha1 import ( crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // RepositoryServerStatusApplyConfiguration represents an declarative configuration of the RepositoryServerStatus type for use // with apply. type RepositoryServerStatusApplyConfiguration struct { - Conditions []v1.Condition `json:"conditions,omitempty"` + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` ServerInfo *ServerInfoApplyConfiguration `json:"serverInfo,omitempty"` Progress *crv1alpha1.RepositoryServerProgress `json:"progress,omitempty"` } @@ -39,9 +39,12 @@ func RepositoryServerStatus() *RepositoryServerStatusApplyConfiguration { // WithConditions adds the given value to the Conditions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *RepositoryServerStatusApplyConfiguration) WithConditions(values ...v1.Condition) *RepositoryServerStatusApplyConfiguration { +func (b *RepositoryServerStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *RepositoryServerStatusApplyConfiguration { for i := range values { - b.Conditions = append(b.Conditions, values[i]) + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) } return b } diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 4e3c7f69a0..c1f5362d43 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -27,8 +27,8 @@ import ( "strings" "sync" + "github.com/kanisterio/errkit" osversioned "github.com/openshift/client-go/apps/clientset/versioned" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "gopkg.in/tomb.v2" corev1 "k8s.io/api/core/v1" @@ -86,23 +86,23 @@ func New(c *rest.Config, reg prometheus.Registerer) *Controller { func (c *Controller) StartWatch(ctx context.Context, namespace string) error { crClient, err := versioned.NewForConfig(c.config) if err != nil { - return errors.Wrap(err, "failed to get a CustomResource client") + return errkit.Wrap(err, "failed to get a CustomResource client") } if err := checkCRAccess(ctx, crClient, namespace); err != nil { return err } clientset, err := kubernetes.NewForConfig(c.config) if err != nil { - return errors.Wrap(err, "failed to get a k8s client") + return errkit.Wrap(err, "failed to get a k8s client") } dynClient, err := dynamic.NewForConfig(c.config) if err != nil { - return errors.Wrap(err, "failed to get a k8s dynamic client") + return errkit.Wrap(err, "failed to get a k8s dynamic client") } osClient, err := osversioned.NewForConfig(c.config) if err != nil { - return errors.Wrap(err, "failed to get a openshift client") + return errkit.Wrap(err, "failed to get a openshift client") } c.crClient = crClient @@ -134,13 +134,13 @@ func (c *Controller) StartWatch(ctx context.Context, namespace string) error { func checkCRAccess(ctx context.Context, cli versioned.Interface, ns string) error { if _, err := cli.CrV1alpha1().ActionSets(ns).List(ctx, metav1.ListOptions{}); err != nil { - return errors.Wrap(err, "Could not list ActionSets") + return errkit.Wrap(err, "Could not list ActionSets") } if _, err := cli.CrV1alpha1().Blueprints(ns).List(ctx, metav1.ListOptions{}); err != nil { - return errors.Wrap(err, "Could not list Blueprints") + return errkit.Wrap(err, "Could not list Blueprints") } if _, err := cli.CrV1alpha1().Profiles(ns).List(ctx, metav1.ListOptions{}); err != nil { - return errors.Wrap(err, "Could not list Profiles") + return errkit.Wrap(err, "Could not list Profiles") } return nil } @@ -220,7 +220,7 @@ func (c *Controller) onAddActionSet(ctx context.Context, t *tomb.Tomb, as *crv1a } as, err := c.crClient.CrV1alpha1().ActionSets(as.GetNamespace()).Get(ctx, as.GetName(), metav1.GetOptions{}) if err != nil { - return errors.WithStack(err) + return errkit.WithStack(err) } if err = validate.ActionSet(as); err != nil { return err @@ -313,13 +313,13 @@ func (c *Controller) initActionSetStatus(ctx context.Context, as *crv1alpha1.Act for _, a := range as.Spec.Actions { if a.Blueprint == "" { // TODO: If no blueprint is specified, we should consider a default. - err = errors.New("Blueprint is not specified for action") + err = errkit.New("Blueprint is not specified for action") c.logAndErrorEvent(ctx, "Could not get blueprint:", "Blueprint not specified", err, as) break } var bp *crv1alpha1.Blueprint if bp, err = c.crClient.CrV1alpha1().Blueprints(as.GetNamespace()).Get(ctx, a.Blueprint, metav1.GetOptions{}); err != nil { - err = errors.Wrap(err, "Failed to query blueprint") + err = errkit.Wrap(err, "Failed to query blueprint") c.logAndErrorEvent(ctx, "Could not get blueprint:", "Error", err, as) break } @@ -349,7 +349,7 @@ func (c *Controller) initActionSetStatus(ctx context.Context, as *crv1alpha1.Act func (c *Controller) initialActionStatus(a crv1alpha1.ActionSpec, bp *crv1alpha1.Blueprint) (*crv1alpha1.ActionStatus, error) { bpa, ok := bp.Actions[a.Name] if !ok { - return nil, errors.Errorf("Action %s for object kind %s not found in blueprint %s", a.Name, a.Object.Kind, a.Blueprint) + return nil, errkit.New(fmt.Sprintf("Action %s for object kind %s not found in blueprint %s", a.Name, a.Object.Kind, a.Blueprint)) } phases := make([]crv1alpha1.Phase, 0, len(bpa.Phases)) for _, p := range bpa.Phases { @@ -379,14 +379,14 @@ func (c *Controller) initialActionStatus(a crv1alpha1.ActionSpec, bp *crv1alpha1 func (c *Controller) handleActionSet(ctx context.Context, t *tomb.Tomb, as *crv1alpha1.ActionSet) (err error) { if as.Status == nil { - return errors.New("ActionSet was not initialized") + return errkit.New("ActionSet was not initialized") } if as.Status.State != crv1alpha1.StatePending { return nil } as.Status.State = crv1alpha1.StateRunning if as, err = c.crClient.CrV1alpha1().ActionSets(as.GetNamespace()).Update(ctx, as, metav1.UpdateOptions{}); err != nil { - return errors.WithStack(err) + return errkit.WithStack(err) } ctx = field.Context(ctx, consts.ActionsetNameKey, as.GetName()) // adding labels with prefix "kanister.io/" in the context as field for better logging @@ -399,7 +399,7 @@ func (c *Controller) handleActionSet(ctx context.Context, t *tomb.Tomb, as *crv1 for i, a := range as.Status.Actions { var bp *crv1alpha1.Blueprint if bp, err = c.crClient.CrV1alpha1().Blueprints(as.GetNamespace()).Get(ctx, a.Blueprint, metav1.GetOptions{}); err != nil { - err = errors.Wrap(err, "Failed to query blueprint") + err = errkit.Wrap(err, "Failed to query blueprint") c.logAndErrorEvent(ctx, "Could not get blueprint:", "Error", err, as) break } @@ -419,7 +419,7 @@ func (c *Controller) handleActionSet(ctx context.Context, t *tomb.Tomb, as *crv1 Message: err.Error(), } _, err = c.crClient.CrV1alpha1().ActionSets(as.GetNamespace()).Update(ctx, as, metav1.UpdateOptions{}) - return errors.WithStack(err) + return errkit.WithStack(err) } log.WithContext(ctx).Print("Created actionset and started executing actions", field.M{"NewActionSetName": as.GetName()}) return nil diff --git a/pkg/controller/controller_test.go b/pkg/controller/controller_test.go index 6f5b8604a0..f5b4210025 100644 --- a/pkg/controller/controller_test.go +++ b/pkg/controller/controller_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "github.com/prometheus/client_golang/prometheus" promgomodel "github.com/prometheus/client_model/go" "gopkg.in/check.v1" @@ -171,12 +171,12 @@ func (s *ControllerSuite) waitOnActionSetState(as *crv1alpha1.ActionSet, state c if as.Status.State == crv1alpha1.StatePending || as.Status.State == crv1alpha1.StateRunning { return false, nil } - return false, errors.New(fmt.Sprintf("Unexpected state: %s", as.Status.State)) + return false, errkit.New(fmt.Sprintf("Unexpected state: %s", as.Status.State)) }) if err == nil { return nil } - return errors.Wrapf(err, "State '%s' never reached", state) + return errkit.Wrap(err, fmt.Sprintf("State '%s' never reached", state)) } func (s *ControllerSuite) waitOnDeferPhaseState(as *crv1alpha1.ActionSet, state crv1alpha1.State) error { @@ -201,7 +201,7 @@ func (s *ControllerSuite) waitOnDeferPhaseState(as *crv1alpha1.ActionSet, state if err == nil { return nil } - return errors.Wrapf(err, "State '%s' never reached", state) + return errkit.Wrap(err, fmt.Sprintf("State '%s' never reached", state)) } func (s *ControllerSuite) waitOnActionSetCompleteWithRunningPhases(as *crv1alpha1.ActionSet, rp *sets.Set[string]) error { @@ -229,12 +229,12 @@ func (s *ControllerSuite) waitOnActionSetCompleteWithRunningPhases(as *crv1alpha } return false, nil } - return false, errors.New(fmt.Sprintf("Unexpected state: %s", as.Status.State)) + return false, errkit.New(fmt.Sprintf("Unexpected state: %s", as.Status.State)) }) if err == nil { return nil } - return errors.Wrapf(err, "ActionSet did not reach '%s' state", crv1alpha1.StateComplete) + return errkit.Wrap(err, fmt.Sprintf("ActionSet did not reach '%s' state", crv1alpha1.StateComplete)) } func newBPWithOutputArtifact() *crv1alpha1.Blueprint { @@ -731,7 +731,7 @@ func (s *ControllerSuite) TestRuntimeObjEventLogs(c *check.C) { config, err := kube.LoadConfig() c.Assert(err, check.IsNil) ctlr := New(config, nil) - ctlr.logAndErrorEvent(ctx, msg, reason, errors.New("Testing Event Logs"), as, nilAs, bp) + ctlr.logAndErrorEvent(ctx, msg, reason, errkit.New("Testing Event Logs"), as, nilAs, bp) // Test ActionSet error event logging events, err := s.cli.CoreV1().Events(as.Namespace).Search(scheme.Scheme, as) @@ -754,7 +754,7 @@ func (s *ControllerSuite) TestRuntimeObjEventLogs(c *check.C) { // Testing empty Blueprint testbp := &crv1alpha1.Blueprint{} - ctlr.logAndErrorEvent(ctx, msg, reason, errors.New("Testing Event Logs"), testbp) + ctlr.logAndErrorEvent(ctx, msg, reason, errkit.New("Testing Event Logs"), testbp) events, err = s.cli.CoreV1().Events(bp.Namespace).Search(scheme.Scheme, testbp) c.Assert(err, check.NotNil) c.Assert(len(events.Items), check.Equals, 0) diff --git a/pkg/controllers/repositoryserver/handler.go b/pkg/controllers/repositoryserver/handler.go index 29677628de..d7325f0c27 100644 --- a/pkg/controllers/repositoryserver/handler.go +++ b/pkg/controllers/repositoryserver/handler.go @@ -22,7 +22,7 @@ import ( "github.com/go-logr/logr" "github.com/jpillora/backoff" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" apimeta "k8s.io/apimachinery/pkg/api/meta" @@ -50,20 +50,20 @@ type RepoServerHandler struct { func (h *RepoServerHandler) CreateOrUpdateOwnedResources(ctx context.Context) error { if err := h.getSecretsFromCR(ctx); err != nil { - return errors.Wrap(err, "Failed to get Kopia API server secrets") + return errkit.Wrap(err, "Failed to get Kopia API server secrets") } svc, err := h.reconcileService(ctx) if err != nil { - return errors.Wrap(err, "Failed to reconcile service") + return errkit.Wrap(err, "Failed to reconcile service") } envVars, pod, err := h.reconcilePod(ctx, svc) if err != nil { - return errors.Wrap(err, "Failed to reconcile Kopia API server pod") + return errkit.Wrap(err, "Failed to reconcile Kopia API server pod") } if err := h.waitForPodReady(ctx, pod); err != nil { - return errors.Wrap(err, "Kopia API server pod not in ready state") + return errkit.Wrap(err, "Kopia API server pod not in ready state") } // envVars are set only when credentials are of type AWS/Azure. @@ -95,7 +95,7 @@ func (h *RepoServerHandler) reconcileService(ctx context.Context) (*corev1.Servi return nil, err } if err := h.updateServerInfoInCRStatus(ctx, h.RepositoryServer.Status.ServerInfo.PodName, svc.Name); err != nil { - return nil, errors.Wrap(err, "Failed to update service name in RepositoryServer /status") + return nil, errkit.Wrap(err, "Failed to update service name in RepositoryServer /status") } return svc, err } @@ -131,7 +131,7 @@ func (h *RepoServerHandler) createService(ctx context.Context, repoServerNamespa } err := h.Reconciler.Create(ctx, &svc) if err != nil { - return nil, errors.Wrap(err, "Failed to create RepositoryServer service") + return nil, errkit.Wrap(err, "Failed to create RepositoryServer service") } err = poll.WaitWithBackoff(ctx, backoff.Backoff{ @@ -184,7 +184,7 @@ func (h *RepoServerHandler) createPodAndUpdateStatus(ctx context.Context, repoSe return nil, nil, err } if err := h.updateServerInfoInCRStatus(ctx, pod.Name, h.RepositoryServer.Status.ServerInfo.ServiceName); err != nil { - return nil, nil, errors.Wrap(err, "Failed to update pod name in RepositoryServer /status") + return nil, nil, errkit.Wrap(err, "Failed to update pod name in RepositoryServer /status") } return envVars, pod, nil } @@ -236,7 +236,7 @@ func (h *RepoServerHandler) createPod(ctx context.Context, repoServerNamespace s return nil, nil, err } if err := h.Reconciler.Create(ctx, pod); err != nil { - return nil, nil, errors.Wrap(err, "Failed to create RepositoryServer pod") + return nil, nil, errkit.Wrap(err, "Failed to create RepositoryServer pod") } return pod, envVars, err } @@ -284,7 +284,7 @@ func (h *RepoServerHandler) preparePodOverride(ctx context.Context, po *kube.Pod h.RepositoryServerSecrets.serverTLS.Name, po, ); err != nil { - return nil, errors.Wrap(err, "Failed to attach TLS Certificate configuration") + return nil, errkit.Wrap(err, "Failed to attach TLS Certificate configuration") } return podOverride, nil } @@ -315,7 +315,7 @@ func (h *RepoServerHandler) updateServerInfoInCRStatus(ctx context.Context, podN func (h *RepoServerHandler) waitForPodReady(ctx context.Context, pod *corev1.Pod) error { if err := kube.WaitForPodReady(ctx, h.KubeCli, pod.Namespace, pod.Name); err != nil { - return errors.Wrap(err, fmt.Sprintf("Failed while waiting for pod %s to be ready", pod.Name)) + return errkit.Wrap(err, fmt.Sprintf("Failed while waiting for pod %s to be ready", pod.Name)) } return nil } diff --git a/pkg/controllers/repositoryserver/repositoryserver_controller.go b/pkg/controllers/repositoryserver/repositoryserver_controller.go index 8616921b95..7e52febac0 100644 --- a/pkg/controllers/repositoryserver/repositoryserver_controller.go +++ b/pkg/controllers/repositoryserver/repositoryserver_controller.go @@ -18,7 +18,7 @@ import ( "context" "github.com/go-logr/logr" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" corev1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -69,11 +69,11 @@ func (r *RepositoryServerReconciler) Reconcile(ctx context.Context, req ctrl.Req logger = logger.V(1) cnf, err := ctrl.GetConfig() if err != nil { - return ctrl.Result{}, errors.Wrap(err, "Failed to get k8s config") + return ctrl.Result{}, errkit.Wrap(err, "Failed to get k8s config") } kubeCli, err := kubernetes.NewForConfig(cnf) if err != nil { - return ctrl.Result{}, errors.Wrap(err, "Failed to get a k8s client") + return ctrl.Result{}, errkit.Wrap(err, "Failed to get a k8s client") } repositoryServer := &crv1alpha1.RepositoryServer{} diff --git a/pkg/controllers/repositoryserver/repositoryserver_controller_test.go b/pkg/controllers/repositoryserver/repositoryserver_controller_test.go index 90b6e9f5fa..b84557e468 100644 --- a/pkg/controllers/repositoryserver/repositoryserver_controller_test.go +++ b/pkg/controllers/repositoryserver/repositoryserver_controller_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" corev1 "k8s.io/api/core/v1" k8sresource "k8s.io/apimachinery/pkg/api/resource" @@ -477,11 +477,11 @@ func (s *RepoServerControllerSuite) waitForRepoServerInfoUpdateInCR(repoServerNa }) if !serverInfoUpdated && err == nil { - err = errors.New("pod name or service name is not set on repository server CR") + err = errkit.New("pod name or service name is not set on repository server CR") } if err != nil { - return errors.Wrapf(err, "failed waiting for RepoServer Info updates in the CR") + return errkit.Wrap(err, "failed waiting for RepoServer Info updates in the CR") } return err } @@ -502,12 +502,12 @@ func (s *RepoServerControllerSuite) waitOnRepositoryServerState(reposerverName s return false, nil } if repoServerCR.Status.Progress == crv1alpha1.Failed { - return false, errors.New(fmt.Sprintf(" There is failure in staring the repository server, server is in %s state, please check logs", repoServerCR.Status.Progress)) + return false, errkit.New(fmt.Sprintf("There is failure in staring the repository server, server is in %s state, please check logs", repoServerCR.Status.Progress)) } if repoServerCR.Status.Progress == crv1alpha1.Ready { return true, nil } - return false, errors.New(fmt.Sprintf("Unexpected Repository server state: %s", repoServerCR.Status.Progress)) + return false, errkit.New(fmt.Sprintf("Unexpected Repository server state: %s", repoServerCR.Status.Progress)) }) return repoServerState, err } diff --git a/pkg/controllers/repositoryserver/secrets_manager.go b/pkg/controllers/repositoryserver/secrets_manager.go index 9272eeafb3..fb66923ea2 100644 --- a/pkg/controllers/repositoryserver/secrets_manager.go +++ b/pkg/controllers/repositoryserver/secrets_manager.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ) @@ -76,14 +76,14 @@ func (h *RepoServerHandler) getSecretsFromCR(ctx context.Context) error { func (h *RepoServerHandler) fetchSecret(ctx context.Context, ref *corev1.SecretReference) (*corev1.Secret, error) { if ref == nil { - return nil, errors.New("repository server CR does not have a secret reference set") + return nil, errkit.New("repository server CR does not have a secret reference set") } h.Logger.Info(fmt.Sprintf("Fetching secret %s from namespace %s", ref.Name, ref.Namespace)) secret := corev1.Secret{} err := h.Reconciler.Get(ctx, types.NamespacedName{Name: ref.Name, Namespace: ref.Namespace}, &secret) if err != nil { - return nil, errors.Wrap(err, fmt.Sprintf("Error fetching secret %s from namespace %s", ref.Name, ref.Namespace)) + return nil, errkit.Wrap(err, fmt.Sprintf("Error fetching secret %s from namespace %s", ref.Name, ref.Namespace)) } return &secret, nil } diff --git a/pkg/controllers/repositoryserver/server.go b/pkg/controllers/repositoryserver/server.go index 16ce3d4a08..9d03c0ea33 100644 --- a/pkg/controllers/repositoryserver/server.go +++ b/pkg/controllers/repositoryserver/server.go @@ -21,7 +21,7 @@ import ( "os" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "k8s.io/kube-openapi/pkg/util/sets" "github.com/kanisterio/kanister/pkg/format" @@ -69,12 +69,12 @@ func (h *RepoServerHandler) startRepoProxyServer(ctx context.Context) (err error format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout) format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr) if err != nil { - return errors.Wrap(err, "Failed to start Kopia API server") + return errkit.Wrap(err, "Failed to start Kopia API server") } err = h.waitForServerReady(ctx, repoServerAddress, serverAdminUserName, serverAdminPassword) if err != nil { - return errors.Wrap(err, "Failed to check Kopia API server status") + return errkit.Wrap(err, "Failed to check Kopia API server status") } return nil } @@ -87,10 +87,10 @@ func (h *RepoServerHandler) getServerDetails(ctx context.Context) (string, strin var serverAdminUsername, serverAdminPassword []byte var ok bool if serverAdminUsername, ok = h.RepositoryServerSecrets.serverAdmin.Data[reposerver.AdminUsernameKey]; !ok { - return "", "", "", errors.New("Server admin username is not specified") + return "", "", "", errkit.New("Server admin username is not specified") } if serverAdminPassword, ok = h.RepositoryServerSecrets.serverAdmin.Data[reposerver.AdminPasswordKey]; !ok { - return "", "", "", errors.New("Server admin password is not specified") + return "", "", "", errkit.New("Server admin password is not specified") } return repoServerAddress, string(serverAdminUsername), string(serverAdminPassword), nil } @@ -98,7 +98,7 @@ func (h *RepoServerHandler) getServerDetails(ctx context.Context) (string, strin func (h *RepoServerHandler) checkServerStatus(ctx context.Context, serverAddress, username, password string) error { cmd, err := h.getServerStatusCommand(ctx, serverAddress, username, password) if err != nil { - return errors.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") + return errkit.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") } stdout, stderr, exErr := kube.Exec(ctx, h.KubeCli, h.RepositoryServer.Namespace, h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, cmd, nil) format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout) @@ -109,7 +109,7 @@ func (h *RepoServerHandler) checkServerStatus(ctx context.Context, serverAddress func (h *RepoServerHandler) waitForServerReady(ctx context.Context, serverAddress, username, password string) error { cmd, err := h.getServerStatusCommand(ctx, serverAddress, username, password) if err != nil { - return errors.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") + return errkit.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") } serverStartTimeOut := h.getRepositoryServerStartTimeout() ctx, cancel := context.WithTimeout(ctx, serverStartTimeOut) @@ -132,14 +132,14 @@ func (h *RepoServerHandler) createOrUpdateClientUsers(ctx context.Context) error format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout) format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr) if err != nil { - return errors.Wrap(err, "Failed to list users from the Kopia repository") + return errkit.Wrap(err, "Failed to list users from the Kopia repository") } userProfiles := []maintenance.KopiaUserProfile{} err = json.Unmarshal([]byte(stdout), &userProfiles) if err != nil { - return errors.Wrap(err, "Failed to unmarshal user list") + return errkit.Wrap(err, "Failed to unmarshal user list") } // Get list of usernames from ServerListUserCommand output to update the existing data with updated password @@ -169,7 +169,7 @@ func (h *RepoServerHandler) createOrUpdateClientUsers(ctx context.Context) error format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout) format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr) if err != nil { - return errors.Wrap(err, "Failed to update existing user passphrase from the Kopia API server") + return errkit.Wrap(err, "Failed to update existing user passphrase from the Kopia API server") } continue } @@ -187,7 +187,7 @@ func (h *RepoServerHandler) createOrUpdateClientUsers(ctx context.Context) error format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout) format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr) if err != nil { - return errors.Wrap(err, "Failed to add new user to the Kopia API server") + return errkit.Wrap(err, "Failed to add new user to the Kopia API server") } } return nil @@ -201,7 +201,7 @@ func (h *RepoServerHandler) refreshServer(ctx context.Context) error { repoPassword := string(h.RepositoryServerSecrets.repositoryPassword.Data[reposerver.RepoPasswordKey]) fingerprint, err := kopia.ExtractFingerprintFromCertSecret(ctx, h.KubeCli, h.RepositoryServerSecrets.serverTLS.Name, h.RepositoryServer.Namespace) if err != nil { - return errors.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") + return errkit.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") } cmd := command.ServerRefresh( @@ -220,7 +220,7 @@ func (h *RepoServerHandler) refreshServer(ctx context.Context) error { format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stdout) format.Log(h.RepositoryServer.Status.ServerInfo.PodName, repoServerPodContainerName, stderr) if err != nil { - return errors.Wrap(err, "Failed to refresh Kopia API server") + return errkit.Wrap(err, "Failed to refresh Kopia API server") } return nil } @@ -241,7 +241,7 @@ func (h *RepoServerHandler) getRepositoryServerStartTimeout() time.Duration { func (h *RepoServerHandler) getServerStatusCommand(ctx context.Context, serverAddress, username, password string) ([]string, error) { fingerprint, err := kopia.ExtractFingerprintFromCertSecret(ctx, h.KubeCli, h.RepositoryServerSecrets.serverTLS.Name, h.RepositoryServer.Namespace) if err != nil { - return nil, errors.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") + return nil, errkit.Wrap(err, "Failed to extract fingerprint from Kopia API server certificate secret data") } cmd := command.ServerStatus( command.ServerStatusCommandArgs{ diff --git a/pkg/controllers/repositoryserver/utils.go b/pkg/controllers/repositoryserver/utils.go index 928dc984bb..0fdcd5af69 100644 --- a/pkg/controllers/repositoryserver/utils.go +++ b/pkg/controllers/repositoryserver/utils.go @@ -22,7 +22,7 @@ import ( "time" "github.com/jpillora/backoff" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -164,12 +164,12 @@ func volumeSpecForName(podSpec corev1.PodSpec, podOverride map[string]interface{ func addTLSCertConfigurationInPodOverride(podOverride *map[string]interface{}, tlsCertSecretName string, po *kube.PodOptions) error { podSpecBytes, err := json.Marshal(*podOverride) if err != nil { - return errors.Wrap(err, "Failed to marshal Pod Override") + return errkit.Wrap(err, "Failed to marshal Pod Override") } var podOverrideSpec corev1.PodSpec if err := json.Unmarshal(podSpecBytes, &podOverrideSpec); err != nil { - return errors.Wrap(err, "Failed to unmarshal Pod Override Spec") + return errkit.Wrap(err, "Failed to unmarshal Pod Override Spec") } podOverrideSpec.Volumes = append(podOverrideSpec.Volumes, corev1.Volume{ @@ -199,11 +199,11 @@ func addTLSCertConfigurationInPodOverride(podOverride *map[string]interface{}, t podSpecBytes, err = json.Marshal(podOverrideSpec) if err != nil { - return errors.Wrap(err, "Failed to marshal Pod Override Spec") + return errkit.Wrap(err, "Failed to marshal Pod Override Spec") } if err := json.Unmarshal(podSpecBytes, podOverride); err != nil { - return errors.Wrap(err, "Failed to unmarshal Pod Override") + return errkit.Wrap(err, "Failed to unmarshal Pod Override") } return nil @@ -235,7 +235,7 @@ func getPodOptions(namespace string, svc *corev1.Service, vols map[string]kube.V func getPodAddress(ctx context.Context, cli kubernetes.Interface, namespace, podName string) (string, error) { p, err := cli.CoreV1().Pods(namespace).Get(ctx, podName, metav1.GetOptions{}) if err != nil { - return "", errors.Wrap(err, "Failed to get pod") + return "", errkit.Wrap(err, "Failed to get pod") } return fmt.Sprintf(repoServerAddressFormat, p.Status.PodIP, repoServerServicePort), nil } @@ -277,17 +277,17 @@ func getVolumes( vols := make(map[string]kube.VolumeMountOptions, 0) var claimName []byte if len(secret.Data) == 0 { - return nil, errors.Errorf(secerrors.EmptySecretErrorMessage, secret.Namespace, secret.Name) + return nil, errkit.New(fmt.Sprintf(secerrors.EmptySecretErrorMessage, secret.Namespace, secret.Name)) } if locationType, ok := (secret.Data[reposerver.TypeKey]); ok && reposerver.LocType(string(locationType)) == reposerver.LocTypeFilestore { if claimName, ok = secret.Data[reposerver.ClaimNameKey]; !ok { - return nil, errors.New("Claim name not set for file store location secret, failed to retrieve PVC") + return nil, errkit.New("Claim name not set for file store location secret, failed to retrieve PVC") } claimNameString := string(claimName) pvc, err := cli.CoreV1().PersistentVolumeClaims(namespace).Get(ctx, claimNameString, metav1.GetOptions{}) if err != nil { - return nil, errors.Wrapf(err, "Failed to validate if PVC %s:%s exists", namespace, claimName) + return nil, errkit.Wrap(err, "Failed to validate if PVC exists", "namespace", namespace, "claimName", claimName) } vols[claimNameString] = kube.VolumeMountOptions{ diff --git a/pkg/errorchecker/errorchecker_test.go b/pkg/errorchecker/errorchecker_test.go index 3a12e5a5ef..f8466a3c14 100644 --- a/pkg/errorchecker/errorchecker_test.go +++ b/pkg/errorchecker/errorchecker_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/kanisterio/errkit" - "github.com/pkg/errors" "gopkg.in/check.v1" ) @@ -18,11 +17,11 @@ var _ = check.Suite(&ErrorsTestSuite{}) func (ts *ErrorsTestSuite) TestWrappingAndMatching(c *check.C) { errkitErr := errkit.New("Errkit error") errkitWrappedErr := errkit.Wrap(errkitErr, "errkit wrapped") - errorsWrappedErr := errors.Wrap(errkitWrappedErr, "errors wrapped") - errorsWrappedErr1 := errors.Wrap(errorsWrappedErr, "errors wrapped 1") + errorsWrappedErr := errkit.Wrap(errkitWrappedErr, "errors wrapped") + errorsWrappedErr1 := errkit.Wrap(errorsWrappedErr, "errors wrapped 1") // Ensure that errors from 'errkit' wrapped by the older 'errors' package remain matchable. - c.Assert(errors.Is(errorsWrappedErr, errkitErr), check.Equals, true) + c.Assert(errkit.Is(errorsWrappedErr, errkitErr), check.Equals, true) // Ensure that transformation to string still works c.Assert(errorsWrappedErr1.Error(), check.Equals, "errors wrapped 1: errors wrapped: errkit wrapped: Errkit error") // Ensure that error message matching does work as expected diff --git a/pkg/function/export_rds_snapshot_location.go b/pkg/function/export_rds_snapshot_location.go index c2df143550..ca32c18251 100644 --- a/pkg/function/export_rds_snapshot_location.go +++ b/pkg/function/export_rds_snapshot_location.go @@ -18,6 +18,7 @@ import ( "context" "encoding/json" "fmt" + "strconv" "strings" "time" @@ -435,6 +436,8 @@ func postgresBackupCommand(dbEndpoint, username, password string, dbList []strin return nil, errkit.New("No database found to backup") } + profileQuoted := strconv.Quote(string(profile)) + command := []string{ "bash", "-o", @@ -452,9 +455,9 @@ func postgresBackupCommand(dbEndpoint, username, password string, dbList []strin for db in "${dblist[@]}"; do echo "backing up $db db" && pg_dump $db -C --inserts > /backup/$db.sql; done - tar -zc backup | kando location push --profile '%s' --path "${BACKUP_PREFIX}/${BACKUP_ID}" - + tar -zc backup | kando location push --profile %s --path "${BACKUP_PREFIX}/${BACKUP_ID}" - kando output %s ${BACKUP_ID}`, - dbEndpoint, backupPrefix, backupID, strings.Join(dbList, " "), profile, ExportRDSSnapshotToLocBackupID), + dbEndpoint, backupPrefix, backupID, strings.Join(dbList, " "), profileQuoted, ExportRDSSnapshotToLocBackupID), } return command, nil } diff --git a/pkg/function/rds_functions_test.go b/pkg/function/rds_functions_test.go index fc037e6749..f278369a05 100644 --- a/pkg/function/rds_functions_test.go +++ b/pkg/function/rds_functions_test.go @@ -60,10 +60,32 @@ func (s *RDSFunctionsTest) TestPrepareCommand(c *check.C) { command: []string{"bash", "-o", "errexit", "-o", "pipefail", "-c", fmt.Sprintf(` export PGHOST=%s - kando location pull --profile '%s' --path "%s" - | gunzip -c -f | sed 's/"LOCALE"/"LC_COLLATE"/' | psql -q -U "${PGUSER}" %s + kando location pull --profile "%s" --path "%s" - | gunzip -c -f | sed 's/"LOCALE"/"LC_COLLATE"/' | psql -q -U "${PGUSER}" %s `, "db-endpoint", "null", fmt.Sprintf("%s/%s", "/backup/postgres-backup", "backup-id"), postgres.DefaultConnectDatabase), }, }, + { + name: "PostgreS restore command with profile", + dbEngine: PostgrSQLEngine, + action: RestoreAction, + dbEndpoint: "db-endpoint", + username: "test-user", + password: "secret-pass", + backupPrefix: "/backup/postgres-backup", + backupID: "backup-id", + dbEngineVersion: "12.7", + errChecker: check.IsNil, + dbList: []string{"template1"}, + command: []string{"bash", "-o", "errexit", "-o", "pipefail", "-c", + fmt.Sprintf(` + export PGHOST=%s + kando location pull --profile "{\"Location\":{\"type\":\"\",\"bucket\":\"\",\"endpoint\":\"\",\"prefix\":\"\",\"region\":\"\"},\"Credential\":{\"Type\":\"\",\"KeyPair\":null,\"Secret\":null,\"KopiaServerSecret\":null},\"SkipSSLVerify\":false}" --path "%s" - | gunzip -c -f | sed 's/"LOCALE"/"LC_COLLATE"/' | psql -q -U "${PGUSER}" %s + `, "db-endpoint", fmt.Sprintf("%s/%s", "/backup/postgres-backup", "backup-id"), postgres.DefaultConnectDatabase), + }, + tp: param.TemplateParams{ + Profile: ¶m.Profile{}, + }, + }, { name: "PostgreS restore command", dbEngine: PostgrSQLEngine, @@ -79,7 +101,7 @@ func (s *RDSFunctionsTest) TestPrepareCommand(c *check.C) { command: []string{"bash", "-o", "errexit", "-o", "pipefail", "-c", fmt.Sprintf(` export PGHOST=%s - kando location pull --profile '%s' --path "%s" - | gunzip -c -f | psql -q -U "${PGUSER}" %s + kando location pull --profile "%s" --path "%s" - | gunzip -c -f | psql -q -U "${PGUSER}" %s `, "db-endpoint", "null", fmt.Sprintf("%s/%s", "/backup/postgres-backup", "backup-id"), postgres.DefaultConnectDatabase), }, }, @@ -106,7 +128,7 @@ func (s *RDSFunctionsTest) TestPrepareCommand(c *check.C) { for db in "${dblist[@]}"; do echo "backing up $db db" && pg_dump $db -C --inserts > /backup/$db.sql; done - tar -zc backup | kando location push --profile '%s' --path "${BACKUP_PREFIX}/${BACKUP_ID}" - + tar -zc backup | kando location push --profile "%s" --path "${BACKUP_PREFIX}/${BACKUP_ID}" - kando output %s ${BACKUP_ID}`, "db-endpoint", "/backup/postgres-backup", "backup-id", strings.Join([]string{"template1"}, " "), "null", ExportRDSSnapshotToLocBackupID), }, diff --git a/pkg/function/restore_rds_snapshot.go b/pkg/function/restore_rds_snapshot.go index df5dd16957..76f482bfdd 100644 --- a/pkg/function/restore_rds_snapshot.go +++ b/pkg/function/restore_rds_snapshot.go @@ -17,6 +17,7 @@ package function import ( "context" "fmt" + "strconv" "time" "github.com/aws/aws-sdk-go/aws" @@ -335,6 +336,8 @@ func postgresRestoreCommand(pgHost, username, password string, backupArtifactPre replaceCommand = ` sed 's/"LOCALE"/"LC_COLLATE"/' |` } + profileQuoted := strconv.Quote(string(profile)) + return []string{ "bash", "-o", @@ -344,8 +347,8 @@ func postgresRestoreCommand(pgHost, username, password string, backupArtifactPre "-c", fmt.Sprintf(` export PGHOST=%s - kando location pull --profile '%s' --path "%s" - | gunzip -c -f |%s psql -q -U "${PGUSER}" %s - `, pgHost, profile, fmt.Sprintf("%s/%s", backupArtifactPrefix, backupID), replaceCommand, postgres.DefaultConnectDatabase), + kando location pull --profile %s --path "%s" - | gunzip -c -f |%s psql -q -U "${PGUSER}" %s + `, pgHost, profileQuoted, fmt.Sprintf("%s/%s", backupArtifactPrefix, backupID), replaceCommand, postgres.DefaultConnectDatabase), }, nil } diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 887c6cb666..97262460f3 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -71,7 +71,8 @@ func RunWebhookServer(c *rest.Config) error { return errors.Wrap(err, "Failed to create new webhook manager") } bpValidator := &validatingwebhook.BlueprintValidator{} - if err = bpValidator.InjectDecoder(admission.NewDecoder(mgr.GetScheme())); err != nil { + decoder := admission.NewDecoder(mgr.GetScheme()) + if err = bpValidator.InjectDecoder(&decoder); err != nil { return errors.Wrap(err, "Failed to inject decoder") } diff --git a/pkg/kando/chronicle_pull.go b/pkg/kando/chronicle_pull.go index 941ee4b335..a61866f449 100644 --- a/pkg/kando/chronicle_pull.go +++ b/pkg/kando/chronicle_pull.go @@ -20,7 +20,7 @@ import ( "io" "os" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "github.com/spf13/cobra" "github.com/kanisterio/kanister/pkg/chronicle" @@ -51,7 +51,7 @@ type locationParams struct { func unmarshalProfile(prof string) (*param.Profile, error) { p := ¶m.Profile{} err := json.Unmarshal([]byte(prof), p) - return p, errors.Wrap(err, "failed to unmarshal profile") + return p, errkit.Wrap(err, "failed to unmarshal profile") } //nolint:unparam diff --git a/pkg/kando/kando.go b/pkg/kando/kando.go index b02ebb8d0e..cc6f2b257c 100644 --- a/pkg/kando/kando.go +++ b/pkg/kando/kando.go @@ -17,7 +17,7 @@ package kando import ( "os" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -60,7 +60,7 @@ func newRootCommand() *cobra.Command { func setLogLevel(v string) error { l, err := logrus.ParseLevel(v) if err != nil { - return errors.Wrap(err, "Invalid log level: "+v) + return errkit.Wrap(err, "Invalid log level: "+v) } logrus.SetLevel(l) return nil diff --git a/pkg/kando/location.go b/pkg/kando/location.go index f6c4e16f75..603c36672a 100644 --- a/pkg/kando/location.go +++ b/pkg/kando/location.go @@ -17,7 +17,7 @@ package kando import ( "encoding/json" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "github.com/spf13/cobra" "github.com/kanisterio/kanister/pkg/datamover" @@ -63,10 +63,10 @@ func validateCommandArgs(cmd *cobra.Command) error { profileFlag := cmd.Flags().Lookup(profileFlagName).Value.String() repositoryServerFlag := cmd.Flags().Lookup(repositoryServerFlagName).Value.String() if profileFlag != "" && repositoryServerFlag != "" { - return errors.New("Either --profile or --repository-server should be provided") + return errkit.New("Either --profile or --repository-server should be provided") } if profileFlag == "" && repositoryServerFlag == "" { - return errors.New("Please provide either --profile or --repository-server as per the datamover you want to use") + return errkit.New("Please provide either --profile or --repository-server as per the datamover you want to use") } return nil } @@ -96,7 +96,7 @@ func dataMoverFromCMD(cmd *cobra.Command, kopiaSnapshot, outputName string) (dat } return datamover.NewRepositoryServerDataMover(repositoryServerRef, outputName, kopiaSnapshot, cmd.Flag(repositoryServerUserHostnameFlagName).Value.String()), nil default: - return nil, errors.New("Could not initialize DataMover.") + return nil, errkit.New("Could not initialize DataMover.") } } @@ -104,14 +104,14 @@ func unmarshalProfileFlag(cmd *cobra.Command) (*param.Profile, error) { profileJSON := cmd.Flag(profileFlagName).Value.String() p := ¶m.Profile{} err := json.Unmarshal([]byte(profileJSON), p) - return p, errors.Wrap(err, "failed to unmarshal profile") + return p, errkit.Wrap(err, "failed to unmarshal profile") } func unmarshalRepositoryServerFlag(cmd *cobra.Command) (*param.RepositoryServer, error) { repositoryServerJSON := cmd.Flag(repositoryServerFlagName).Value.String() rs := ¶m.RepositoryServer{} err := json.Unmarshal([]byte(repositoryServerJSON), rs) - return rs, errors.Wrap(err, "failed to unmarshal kopia repository server CR") + return rs, errkit.Wrap(err, "failed to unmarshal kopia repository server CR") } func dataMoverTypeFromCMD(c *cobra.Command) DataMoverType { diff --git a/pkg/kando/output.go b/pkg/kando/output.go index 3c8e092da5..fd92b03dff 100644 --- a/pkg/kando/output.go +++ b/pkg/kando/output.go @@ -15,7 +15,9 @@ package kando import ( - "github.com/pkg/errors" + "fmt" + + "github.com/kanisterio/errkit" "github.com/spf13/cobra" "github.com/kanisterio/kanister/pkg/output" @@ -34,7 +36,7 @@ func newOutputCommand() *cobra.Command { func validateArguments(c *cobra.Command, args []string) error { if len(args) != 2 { - return errors.Errorf("Command accepts 2 arguments, received %d arguments", len(args)) + return errkit.New(fmt.Sprintf("Command accepts 2 arguments, received %d arguments", len(args))) } return output.ValidateKey(args[0]) } diff --git a/pkg/kanx/server.go b/pkg/kanx/server.go index 50883ff938..eab13e1f22 100644 --- a/pkg/kanx/server.go +++ b/pkg/kanx/server.go @@ -3,7 +3,6 @@ package kanx import ( "bytes" "context" - "fmt" "io" "net" "os" @@ -12,7 +11,7 @@ import ( "syscall" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "google.golang.org/grpc" "github.com/kanisterio/kanister/pkg/field" @@ -117,12 +116,12 @@ func (s *processServiceServer) ListProcesses(lpr *ListProcessesRequest, lps Proc return nil } -var errProcessNotFound = fmt.Errorf("Process not found") +var errProcessNotFound = errkit.NewSentinelErr("Process not found") func (s *processServiceServer) Stdout(por *ProcessOutputRequest, ss ProcessService_StdoutServer) error { p, ok := s.processes[por.Pid] if !ok { - return errors.WithStack(errProcessNotFound) + return errkit.WithStack(errProcessNotFound) } fh, err := os.Open(p.stdout.Name()) if err != nil { @@ -134,7 +133,7 @@ func (s *processServiceServer) Stdout(por *ProcessOutputRequest, ss ProcessServi func (s *processServiceServer) Stderr(por *ProcessOutputRequest, ss ProcessService_StderrServer) error { p, ok := s.processes[por.Pid] if !ok { - return errors.WithStack(errProcessNotFound) + return errkit.WithStack(errProcessNotFound) } fh, err := os.Open(p.stderr.Name()) if err != nil { diff --git a/pkg/kopia/cli/errors.go b/pkg/kopia/cli/errors.go index 68153212d5..4d08eb48cc 100644 --- a/pkg/kopia/cli/errors.go +++ b/pkg/kopia/cli/errors.go @@ -15,29 +15,29 @@ package cli import ( - "github.com/pkg/errors" + "github.com/kanisterio/errkit" ) // Common errors var ( // ErrInvalidID is returned when the ID is empty. - ErrInvalidID = errors.New("invalid ID") + ErrInvalidID = errkit.NewSentinelErr("invalid ID") ) // storage errors var ( // ErrUnsupportedStorage is returned when the storage is not supported. - ErrUnsupportedStorage = errors.New("unsupported storage") + ErrUnsupportedStorage = errkit.NewSentinelErr("unsupported storage") // ErrInvalidRepoPath is returned when the repoPath is empty. - ErrInvalidRepoPath = errors.New("repository path cannot be empty") + ErrInvalidRepoPath = errkit.NewSentinelErr("repository path cannot be empty") // ErrInvalidPrefix is returned when the prefix is empty. - ErrInvalidPrefix = errors.New("prefix cannot be empty") + ErrInvalidPrefix = errkit.NewSentinelErr("prefix cannot be empty") // ErrInvalidBucketName is returned when the bucketName is empty. - ErrInvalidBucketName = errors.New("bucket name cannot be empty") + ErrInvalidBucketName = errkit.NewSentinelErr("bucket name cannot be empty") // ErrInvalidCredentialsFile is returned when the credentials file is empty. - ErrInvalidCredentialsFile = errors.New("credentials file cannot be empty") + ErrInvalidCredentialsFile = errkit.NewSentinelErr("credentials file cannot be empty") // ErrInvalidContainerName is returned when the containerName is empty. - ErrInvalidContainerName = errors.New("container name cannot be empty") + ErrInvalidContainerName = errkit.NewSentinelErr("container name cannot be empty") // ErrInvalidServerURL is returned when the serverURL is empty. - ErrInvalidServerURL = errors.New("server URL cannot be empty") + ErrInvalidServerURL = errkit.NewSentinelErr("server URL cannot be empty") ) diff --git a/pkg/kopia/cli/internal/test/command_suite.go b/pkg/kopia/cli/internal/test/command_suite.go index 57a8c2f96d..660909dc6d 100644 --- a/pkg/kopia/cli/internal/test/command_suite.go +++ b/pkg/kopia/cli/internal/test/command_suite.go @@ -15,9 +15,9 @@ package test import ( + "github.com/kanisterio/errkit" "github.com/kanisterio/safecli" "github.com/kanisterio/safecli/test" - "github.com/pkg/errors" "gopkg.in/check.v1" ) @@ -62,8 +62,7 @@ func (t *CommandTest) assertNoError(c *check.C, err error) { // assertError checks the error against ExpectedErr. func (t *CommandTest) assertError(c *check.C, err error) { - actualErr := errors.Cause(err) - c.Assert(actualErr, check.Equals, t.ExpectedErr) + c.Assert(errkit.Is(err, t.ExpectedErr), check.Equals, true) } // assertCLI asserts the builder's CLI output against ExpectedCLI. diff --git a/pkg/kopia/cli/repository/opts.go b/pkg/kopia/cli/repository/opts.go index 31c92ab0e5..fd05a901ca 100644 --- a/pkg/kopia/cli/repository/opts.go +++ b/pkg/kopia/cli/repository/opts.go @@ -15,11 +15,12 @@ package repository import ( + "fmt" "time" "github.com/go-openapi/strfmt" + "github.com/kanisterio/errkit" "github.com/kanisterio/safecli/command" - "github.com/pkg/errors" "github.com/kanisterio/kanister/pkg/kopia/cli" "github.com/kanisterio/kanister/pkg/kopia/cli/internal" @@ -91,7 +92,7 @@ func optStorage(l internal.Location, repoPathPrefix string, logger log.Logger) c } func errUnsupportedStorageType(t rs.LocType) command.Applier { - err := errors.Wrapf(cli.ErrUnsupportedStorage, "storage location: %v", t) + err := errkit.Wrap(cli.ErrUnsupportedStorage, fmt.Sprintf("storage location: %v", t)) return command.NewErrorArgument(err) } diff --git a/pkg/kopia/errors/utils_test.go b/pkg/kopia/errors/utils_test.go index e4370f0406..7ef1debfd9 100644 --- a/pkg/kopia/errors/utils_test.go +++ b/pkg/kopia/errors/utils_test.go @@ -18,7 +18,6 @@ import ( "testing" "github.com/kanisterio/errkit" - "github.com/pkg/errors" "gopkg.in/check.v1" ) @@ -31,17 +30,14 @@ var _ = check.Suite(&KopiaErrorsTestSuite{}) // TestErrCheck verifies that error types are properly detected after wrapping them func (s *KopiaErrorsTestSuite) TestErrCheck(c *check.C) { - origErr := errors.New("Some error") + origErr := errkit.New("Some error") - errWithMessage := errors.WithMessage(origErr, ErrInvalidPasswordStr) errWrapped := errkit.Wrap(origErr, ErrInvalidPasswordStr) - c.Assert(IsInvalidPasswordError(errWithMessage), check.Equals, true) c.Assert(IsInvalidPasswordError(errWrapped), check.Equals, true) c.Assert(IsRepoNotFoundError(errWrapped), check.Equals, false) permittedErrors := []ErrorType{ErrorInvalidPassword, ErrorRepoNotFound} - c.Assert(CheckKopiaErrors(errWithMessage, permittedErrors), check.Equals, true) c.Assert(CheckKopiaErrors(errWrapped, permittedErrors), check.Equals, true) wrongErrors := []ErrorType{ErrorRepoNotFound} diff --git a/pkg/ksprig/fipsonly_sprig_test.go b/pkg/ksprig/fipsonly_sprig_test.go index 7a2ea4968c..e45409c72e 100644 --- a/pkg/ksprig/fipsonly_sprig_test.go +++ b/pkg/ksprig/fipsonly_sprig_test.go @@ -15,11 +15,11 @@ package ksprig_test import ( - "errors" "strings" "testing" "text/template" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" "github.com/kanisterio/kanister/pkg/ksprig" @@ -74,7 +74,7 @@ func (f *FipsOnlySprigSuite) TestUnsupportedTxtFuncMapUsage(c *check.C) { err = temp.Execute(nil, "") var sprigErr ksprig.UnsupportedSprigUsageErr - c.Assert(errors.As(err, &sprigErr), check.Equals, true) + c.Assert(errkit.As(err, &sprigErr), check.Equals, true) c.Assert(sprigErr.Usage, check.Equals, tc.usageErr) } } diff --git a/pkg/kube/exec_test.go b/pkg/kube/exec_test.go index 9242abb4ec..2475a54fad 100644 --- a/pkg/kube/exec_test.go +++ b/pkg/kube/exec_test.go @@ -20,10 +20,10 @@ package kube import ( "bytes" "context" - "errors" "strings" "time" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -191,7 +191,7 @@ func (s *ExecSuite) TestErrorInExecWithOptions(c *check.C) { c.Assert(err1, check.Not(check.IsNil)) var ee1 *ExecError - ok := errors.As(err1, &ee1) + ok := errkit.As(err1, &ee1) c.Assert(ok, check.Equals, true) c.Assert(ee1.Stdout(), check.Not(check.Equals), testCase.expectedOut) c.Assert(ee1.Stderr(), check.Not(check.Equals), testCase.expectedErr) @@ -208,7 +208,7 @@ func (s *ExecSuite) TestErrorInExecWithOptions(c *check.C) { c.Assert(err2, check.Not(check.IsNil)) var ee2 *ExecError - ok = errors.As(err2, &ee2) + ok = errkit.As(err2, &ee2) c.Assert(ok, check.Equals, true) // When error happens, stdout/stderr buffers should contain all lines produced by an app diff --git a/pkg/kube/log_reader_test.go b/pkg/kube/log_reader_test.go index b83a89ea29..55fed677c7 100644 --- a/pkg/kube/log_reader_test.go +++ b/pkg/kube/log_reader_test.go @@ -3,9 +3,9 @@ package kube import ( "bytes" "context" - "errors" "io" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" "k8s.io/client-go/rest" ) @@ -39,7 +39,7 @@ func (frw *fakeResponseWrapper) Stream(context.Context) (io.ReadCloser, error) { } func (s *LogReaderSuite) TestLogReader(c *check.C) { - err := errors.New("TEST") + err := errkit.New("TEST") for _, tc := range []struct { rw *fakeResponseWrapper err error diff --git a/pkg/kube/pod.go b/pkg/kube/pod.go index 8baf644565..09be10c94c 100644 --- a/pkg/kube/pod.go +++ b/pkg/kube/pod.go @@ -27,7 +27,6 @@ import ( "github.com/gofrs/uuid" json "github.com/json-iterator/go" "github.com/kanisterio/errkit" - "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -451,7 +450,7 @@ func checkPVCAndPVStatus(ctx context.Context, vol corev1.Volume, p *corev1.Pod, pvcName := vol.VolumeSource.PersistentVolumeClaim.ClaimName pvc, err := cli.CoreV1().PersistentVolumeClaims(namespace).Get(ctx, pvcName, metav1.GetOptions{}) if err != nil { - if apierrors.IsNotFound(errors.Cause(err)) { + if apierrors.IsNotFound(err) { // Do not return err, wait for timeout, since sometimes in case of statefulsets, they trigger creation of a volume return nil } @@ -470,7 +469,7 @@ func checkPVCAndPVStatus(ctx context.Context, vol corev1.Volume, p *corev1.Pod, } pv, err := cli.CoreV1().PersistentVolumes().Get(ctx, pvName, metav1.GetOptions{}) if err != nil { - if apierrors.IsNotFound(errors.Cause(err)) { + if apierrors.IsNotFound(err) { // wait for timeout return nil } diff --git a/pkg/kube/pod_command_executor_test.go b/pkg/kube/pod_command_executor_test.go index bc037dad47..064e6b35c0 100644 --- a/pkg/kube/pod_command_executor_test.go +++ b/pkg/kube/pod_command_executor_test.go @@ -17,11 +17,11 @@ package kube import ( "bytes" "context" - "errors" "os" "sync" "time" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" "k8s.io/client-go/kubernetes/fake" ) @@ -129,7 +129,7 @@ func (s *PodCommandExecutorTestSuite) TestPodRunnerExec(c *check.C) { prp.execWithOptionsSyncEnd.Sync() c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, context.DeadlineExceeded), check.Equals, true) + c.Assert(errkit.Is(err, context.DeadlineExceeded), check.Equals, true) }, "Cancelled": func(ctx context.Context, pr PodCommandExecutor, prp *fakePodCommandExecutorProcessor) { var err error @@ -151,7 +151,7 @@ func (s *PodCommandExecutorTestSuite) TestPodRunnerExec(c *check.C) { prp.execWithOptionsSyncEnd.Sync() // Release ExecWithOptions c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, context.Canceled), check.Equals, true) + c.Assert(errkit.Is(err, context.Canceled), check.Equals, true) }, "Successful execution": func(ctx context.Context, pr PodCommandExecutor, prp *fakePodCommandExecutorProcessor) { var err error diff --git a/pkg/kube/pod_controller_test.go b/pkg/kube/pod_controller_test.go index b2172ca21c..1555070569 100644 --- a/pkg/kube/pod_controller_test.go +++ b/pkg/kube/pod_controller_test.go @@ -16,7 +16,6 @@ package kube import ( "context" - "errors" "fmt" "os" "time" @@ -46,14 +45,14 @@ func (s *PodControllerTestSuite) TestPodControllerStartPod(c *check.C) { ctx := context.Background() cli := fake.NewSimpleClientset() - simulatedError := errors.New("SimulatedError") + simulatedError := errkit.New("SimulatedError") cases := map[string]func(prp *FakePodControllerProcessor, pr PodController){ "Pod creation failure": func(pcp *FakePodControllerProcessor, pc PodController) { pcp.CreatePodErr = simulatedError err := pc.StartPod(ctx) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, simulatedError), check.Equals, true) + c.Assert(errkit.Is(err, simulatedError), check.Equals, true) c.Assert(pcp.InCreatePodOptions, check.DeepEquals, &PodOptions{ Namespace: podControllerNS, Name: podControllerPodName, @@ -81,11 +80,11 @@ func (s *PodControllerTestSuite) TestPodControllerStartPod(c *check.C) { prp.InCreatePodOptions = nil prp.CreatePodRet = nil - prp.CreatePodErr = errors.New("CreatePod should not be invoked") + prp.CreatePodErr = errkit.New("CreatePod should not be invoked") err = pr.StartPod(ctx) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, ErrPodControllerPodAlreadyStarted), check.Equals, true) + c.Assert(errkit.Is(err, ErrPodControllerPodAlreadyStarted), check.Equals, true) c.Assert(prp.InCreatePodOptions, check.IsNil) }, } @@ -108,13 +107,13 @@ func (s *PodControllerTestSuite) TestPodControllerWaitPod(c *check.C) { ctx := context.Background() cli := fake.NewSimpleClientset() - simulatedError := errkit.Wrap(errors.New("SimulatedError"), "Wrapped") + simulatedError := errkit.Wrap(errkit.New("SimulatedError"), "Wrapped") cases := map[string]func(pcp *FakePodControllerProcessor, pc PodController){ "Waiting failed because pod not started yet": func(pcp *FakePodControllerProcessor, pc PodController) { err := pc.WaitForPodReady(ctx) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) + c.Assert(errkit.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) c.Assert(pcp.InCreatePodOptions, check.IsNil) }, "Waiting failed due to timeout": func(pcp *FakePodControllerProcessor, pc PodController) { @@ -132,7 +131,7 @@ func (s *PodControllerTestSuite) TestPodControllerWaitPod(c *check.C) { c.Assert(err, check.Not(check.IsNil)) c.Assert(pcp.InWaitForPodReadyPodName, check.Equals, podControllerPodName) c.Assert(pcp.InWaitForPodReadyNamespace, check.Equals, podControllerNS) - c.Assert(errors.Is(err, pcp.WaitForPodReadyErr), check.Equals, true) + c.Assert(errkit.Is(err, pcp.WaitForPodReadyErr), check.Equals, true) c.Assert(err.Error(), check.Equals, fmt.Sprintf("Pod failed to become ready in time: %s", simulatedError.Error())) // Check that POD deletion was also invoked with expected arguments @@ -169,13 +168,13 @@ func (s *PodControllerTestSuite) TestPodControllerStopPod(c *check.C) { cli := fake.NewSimpleClientset() untouchedStr := "DEADBEEF" - simulatedError := errors.New("SimulatedError") + simulatedError := errkit.New("SimulatedError") cases := map[string]func(pcp *FakePodControllerProcessor, pc PodController){ "Pod not started yet": func(pcp *FakePodControllerProcessor, pc PodController) { err := pc.StopPod(ctx, 30*time.Second, int64(0)) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) + c.Assert(errkit.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) c.Assert(pcp.InDeletePodPodName, check.Equals, untouchedStr) c.Assert(pcp.InDeletePodNamespace, check.Equals, untouchedStr) }, @@ -192,7 +191,7 @@ func (s *PodControllerTestSuite) TestPodControllerStopPod(c *check.C) { pcp.DeletePodErr = simulatedError err = pc.StopPod(ctx, 30*time.Second, int64(0)) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, simulatedError), check.Equals, true) + c.Assert(errkit.Is(err, simulatedError), check.Equals, true) }, "Pod successfully deleted": func(pcp *FakePodControllerProcessor, pc PodController) { pcp.CreatePodRet = &corev1.Pod{ @@ -239,12 +238,12 @@ func (s *PodControllerTestSuite) TestPodControllerGetCommandExecutorAndFileWrite pce, err := pc.GetCommandExecutor() c.Assert(pce, check.IsNil) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) + c.Assert(errkit.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) pfw, err := pc.GetFileWriter() c.Assert(pfw, check.IsNil) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) + c.Assert(errkit.Is(err, ErrPodControllerPodNotStarted), check.Equals, true) }, "Pod not ready yet": func(pcp *FakePodControllerProcessor, pc PodController) { pcp.CreatePodRet = &corev1.Pod{ @@ -258,12 +257,12 @@ func (s *PodControllerTestSuite) TestPodControllerGetCommandExecutorAndFileWrite pce, err := pc.GetCommandExecutor() c.Assert(pce, check.IsNil) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, ErrPodControllerPodNotReady), check.Equals, true) + c.Assert(errkit.Is(err, ErrPodControllerPodNotReady), check.Equals, true) pfw, err := pc.GetFileWriter() c.Assert(pfw, check.IsNil) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, ErrPodControllerPodNotReady), check.Equals, true) + c.Assert(errkit.Is(err, ErrPodControllerPodNotReady), check.Equals, true) }, "CommandExecutor successfully returned": func(pcp *FakePodControllerProcessor, pc PodController) { pcp.CreatePodRet = &corev1.Pod{ diff --git a/pkg/kube/pod_file_writer_test.go b/pkg/kube/pod_file_writer_test.go index c9c45636b1..85e6a95e4b 100644 --- a/pkg/kube/pod_file_writer_test.go +++ b/pkg/kube/pod_file_writer_test.go @@ -17,7 +17,6 @@ package kube import ( "bytes" "context" - "errors" "io" "os" @@ -90,7 +89,7 @@ func (s *PodFileWriterTestSuite) TestPodRunnerWriteFile(c *check.C) { buf := bytes.NewBuffer([]byte("some file content")) remover, err := pfw.Write(ctx, "/path/to/file", buf) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, simulatedError), check.Equals, true) + c.Assert(errkit.Is(err, simulatedError), check.Equals, true) c.Assert(remover, check.IsNil) c.Assert(pfwp.podWriter.inWriteNamespace, check.Equals, podFileWriterNS) @@ -130,7 +129,7 @@ func (s *PodFileWriterTestSuite) TestPodRunnerWriteFile(c *check.C) { err = remover.Remove(ctx) c.Assert(err, check.Not(check.IsNil)) - c.Assert(errors.Is(err, simulatedError), check.Equals, true) + c.Assert(errkit.Is(err, simulatedError), check.Equals, true) c.Assert(pfwp.podWriter.inRemoveNamespace, check.Equals, podFileWriterNS) c.Assert(pfwp.podWriter.inRemovePodName, check.Equals, podFileWriterPodName) c.Assert(pfwp.podWriter.inRemoveContainerName, check.Equals, podFileWriterContainerName) diff --git a/pkg/kube/pod_runner_test.go b/pkg/kube/pod_runner_test.go index a3b8c21d61..20a312b1c8 100644 --- a/pkg/kube/pod_runner_test.go +++ b/pkg/kube/pod_runner_test.go @@ -19,7 +19,7 @@ import ( "os" "path" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" @@ -191,10 +191,10 @@ func afterPodRunTestKeyPresentFunc(labelKey, expectedLabelValue string, isLabelE <-ch labelValue, found := pc.Pod().Labels[labelKey] if found != isLabelExpected { - return nil, errors.New("Got different label than expected") + return nil, errkit.New("Got different label than expected") } if isLabelExpected && labelValue != expectedLabelValue { - return nil, errors.New("Found label doesn't match with expected label") + return nil, errkit.New("Found label doesn't match with expected label") } return nil, nil } diff --git a/pkg/kube/pod_test.go b/pkg/kube/pod_test.go index 852dd29f10..e14878821b 100644 --- a/pkg/kube/pod_test.go +++ b/pkg/kube/pod_test.go @@ -19,14 +19,15 @@ package kube import ( "context" - "errors" "fmt" "os" "strings" "time" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -315,7 +316,7 @@ func (s *PodSuite) TestPodWithFilesystemModeVolumes(c *check.C) { ca := action.(testing.CreateAction) p = ca.GetObject().(*corev1.Pod) if len(p.Spec.Volumes[0].Name) > 63 { - return true, nil, errors.New("spec.volumes[0].name must be no more than 63 characters") + return true, nil, errkit.New("spec.volumes[0].name must be no more than 63 characters") } return false, nil, nil }) @@ -364,7 +365,7 @@ func (s *PodSuite) TestPodWithFilesystemModeReadOnlyVolumes(c *check.C) { ca := action.(testing.CreateAction) p = ca.GetObject().(*corev1.Pod) if len(p.Spec.Volumes[0].Name) > 63 { - return true, nil, errors.New("spec.volumes[0].name must be no more than 63 characters") + return true, nil, errkit.New("spec.volumes[0].name must be no more than 63 characters") } return false, nil, nil }) @@ -415,7 +416,7 @@ func (s *PodSuite) TestPodWithBlockModeVolumes(c *check.C) { ca := action.(testing.CreateAction) p = ca.GetObject().(*corev1.Pod) if len(p.Spec.Volumes[0].Name) > 63 { - return true, nil, errors.New("spec.volumes[0].name must be no more than 63 characters") + return true, nil, errkit.New("spec.volumes[0].name must be no more than 63 characters") } return false, nil, nil }) @@ -1244,3 +1245,19 @@ func (s *PodSuite) TestAddAnnotations(c *check.C) { c.Assert(tc.podOptions, check.DeepEquals, tc.expectedPodOptions) } } + +// TestErrkitApiErrorsWrapping verifies that apierrors wrapped with errkit.Wrap are still matchable using apierrors matchers +func (s *PodSuite) TestErrkitApiErrorsWrapping(c *check.C) { + // Create the fake client + fakeClient := fake.NewSimpleClientset() + + // Add a reactor to simulate an error when trying to get a PVC + fakeClient.PrependReactor("get", "persistentvolumeclaims", func(action testing.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, errkit.Wrap(apierrors.NewNotFound(action.GetResource().GroupResource(), action.GetSubresource()), "Some context") + }) + + _, err := fakeClient.CoreV1().PersistentVolumeClaims("abc").Get(context.TODO(), "def", metav1.GetOptions{}) + if err != nil { + c.Assert(apierrors.IsNotFound(err), check.Equals, true) + } +} diff --git a/pkg/log/fluentbit.go b/pkg/log/fluentbit.go index 36a03397a3..2c2d11cf22 100644 --- a/pkg/log/fluentbit.go +++ b/pkg/log/fluentbit.go @@ -7,7 +7,7 @@ import ( "os" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "github.com/sirupsen/logrus" ) @@ -64,7 +64,7 @@ func NewFluentbitHook(endpoint string) *FluentbitHook { func dial(endpoint string) (net.Conn, error) { conn, err := net.DialTimeout("tcp", endpoint, defaultConnTimeout) if err != nil { - return nil, errors.Wrap(err, "Fluentbit connection problem") + return nil, errkit.Wrap(err, "Fluentbit connection problem") } return conn, nil } @@ -73,12 +73,12 @@ func dial(endpoint string) (net.Conn, error) { func handle(msgs []byte, endpoint string) error { conn, err := dial(endpoint) if err != nil { - return errors.Wrap(err, "Fluentbit connection error") + return errkit.Wrap(err, "Fluentbit connection error") } defer conn.Close() //nolint:errcheck _, err = conn.Write(msgs) if err != nil { - return errors.Wrap(err, "Fluentbit write error") + return errkit.Wrap(err, "Fluentbit write error") } return nil } diff --git a/pkg/log/log.go b/pkg/log/log.go index fcd1932cb0..a5363fbc16 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "github.com/sirupsen/logrus" "github.com/kanisterio/kanister/pkg/caller" @@ -34,9 +34,9 @@ const ( ) var ( - ErrEndpointNotSet = errors.New("fluentbit endpoint not set") - ErrNonTCPEndpoint = errors.New("fluentbit endpoint scheme must be tcp") - ErrPathSet = errors.New("fluentbit endpoint path is set") + ErrEndpointNotSet = errkit.NewSentinelErr("fluentbit endpoint not set") + ErrNonTCPEndpoint = errkit.NewSentinelErr("fluentbit endpoint scheme must be tcp") + ErrPathSet = errkit.NewSentinelErr("fluentbit endpoint path is set") ) // OutputSink describes the current output sink. @@ -72,17 +72,17 @@ func SetOutput(sink OutputSink) error { case FluentbitSink: fbitAddr, ok := os.LookupEnv(LoggingServiceHostEnv) if !ok { - return errors.New("Unable to find Fluentbit host address") + return errkit.New("Unable to find Fluentbit host address") } fbitPort, ok := os.LookupEnv(LoggingServicePortEnv) if !ok { - return errors.New("Unable to find Fluentbit logging port") + return errkit.New("Unable to find Fluentbit logging port") } hook := NewFluentbitHook(fbitAddr + ":" + fbitPort) log.AddHook(hook) return nil default: - return errors.New("not implemented") + return errkit.New("not implemented") } } diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index 838942d7eb..2cb20b1e76 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/json" - "errors" "fmt" "net/url" "os" @@ -12,6 +11,7 @@ import ( "testing" "time" + "github.com/kanisterio/errkit" "github.com/sirupsen/logrus" "gopkg.in/check.v1" @@ -59,7 +59,7 @@ func (s *LogSuite) TestLogWithFields(c *check.C) { func (s *LogSuite) TestLogWithError(c *check.C) { const text = "My error message" - err := errors.New("test error") + err := errkit.New("test error") entry := testLogMessage(c, text, WithError(err).Print) c.Assert(entry["error"], check.Equals, err.Error()) c.Assert(entry["level"], check.Equals, infoLevelStr) @@ -88,7 +88,7 @@ func (s *LogSuite) TestLogWithContextFields(c *check.C) { func (s *LogSuite) TestLogWithContextFieldsAndError(c *check.C) { const text = "My error message" ctx := field.Context(context.Background(), "key", "value") - err := errors.New("test error") + err := errkit.New("test error") entry := testLogMessage(c, text, WithError(err).WithContext(ctx).Print) c.Assert(entry["level"], check.Equals, infoLevelStr) // Error should be included in the log entry diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index 7831683a47..011d1debf3 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -15,9 +15,9 @@ package metrics import ( - "errors" "fmt" + "github.com/kanisterio/errkit" "github.com/prometheus/client_golang/prometheus" "gonum.org/v1/gonum/stat/combin" @@ -73,7 +73,7 @@ func getLabelCombinations(bl []BoundedLabel) ([]prometheus.Labels, error) { {"operation_type": "restore", "action_set_resolution": "failure"}] */ if !verifyBoundedLabels(bl) { - return nil, errors.New("invalid BoundedLabel list") + return nil, errkit.New("invalid BoundedLabel list") } labelLens := make([]int, len(bl)) for idx, l := range bl { @@ -241,7 +241,7 @@ func registerGauge(r prometheus.Registerer, g prometheus.Gauge) prometheus.Gauge func registerMetricOrDie(r prometheus.Registerer, c prometheus.Collector) prometheus.Collector { if err := r.Register(c); err != nil { are := prometheus.AlreadyRegisteredError{} - if !errors.As(err, &are) { + if !errkit.As(err, &are) { panic(fmt.Sprintf("failed to register metric. error: %v", err)) } // Use already registered metric diff --git a/pkg/objectstore/directory.go b/pkg/objectstore/directory.go index f184c29449..d228230cc1 100644 --- a/pkg/objectstore/directory.go +++ b/pkg/objectstore/directory.go @@ -234,7 +234,7 @@ func (d *directory) Put(ctx context.Context, name string, r io.Reader, size int6 if d.path == "" { return errors.New("invalid entry") } - // K10 tags include '/'. Remove them, at least for S3 + // Replace any '/' in tags with '-'. sTags := sanitizeTags(tags) objName := d.absPathName(name) diff --git a/pkg/testing/e2e_test.go b/pkg/testing/e2e_test.go index 17ef519cd3..3e3ffd41e0 100644 --- a/pkg/testing/e2e_test.go +++ b/pkg/testing/e2e_test.go @@ -23,7 +23,7 @@ import ( "log" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -166,7 +166,7 @@ func (s *E2ESuite) TestKubeExec(c *check.C) { case err != nil, as.Status == nil: return false, err case as.Status.State == crv1alpha1.StateFailed: - return true, errors.Errorf("Actionset failed: %#v", as.Status) + return true, errkit.New(fmt.Sprintf("Actionset failed: %#v", as.Status)) case as.Status.State == crv1alpha1.StateComplete: return true, nil } @@ -290,7 +290,7 @@ func (s *E2ESuite) TestKubeTask(c *check.C) { case err != nil, as.Status == nil: return false, err case as.Status.State == crv1alpha1.StateFailed: - return true, errors.Errorf("Actionset failed: %#v", as.Status) + return true, errkit.New(fmt.Sprintf("Actionset failed: %#v", as.Status)) case as.Status.State == crv1alpha1.StateComplete: return true, nil } @@ -524,7 +524,7 @@ func (s *E2ESuite) waitForActionSetComplete(asName string) error { case err != nil, as.Status == nil: return false, err case as.Status.State == crv1alpha1.StateFailed: - return true, errors.Errorf("Actionset failed: %#v", as.Status) + return true, errkit.New(fmt.Sprintf("Actionset failed: %#v", as.Status)) case as.Status.State == crv1alpha1.StateComplete: return true, nil } @@ -553,7 +553,7 @@ func (s *E2ESuite) waitForFunctionPodReady() error { } if len(pods.Items) > 1 { - return false, errors.New("more than one kanister-job pod found") + return false, errkit.New("more than one kanister-job pod found") } return true, nil @@ -564,7 +564,7 @@ func verifyAnnotationsInFunctionPod(funcPodAnnotations, expectedAnnotations map[ for k, v := range expectedAnnotations { val, ok := funcPodAnnotations[k] if !ok || v != val { - return errors.New(fmt.Sprintf("Either key %s, is not found in pod annotations or, its values (%s and %s) don't match", k, v, val)) + return errkit.New(fmt.Sprintf("Either key %s, is not found in pod annotations or, its values (%s and %s) don't match", k, v, val)) } } return nil @@ -574,7 +574,7 @@ func verifyLabelsInFunctionPod(funcPodLabels, expectedLabels map[string]string) for k, v := range expectedLabels { val, ok := funcPodLabels[k] if !ok || v != val { - return errors.New(fmt.Sprintf("Either key %s, is not found in pod labels or, its values (%s and %s) don't match", k, v, val)) + return errkit.New(fmt.Sprintf("Either key %s, is not found in pod labels or, its values (%s and %s) don't match", k, v, val)) } } return nil diff --git a/pkg/testing/integration_test.go b/pkg/testing/integration_test.go index 80bce4d248..baf3ca8fc7 100644 --- a/pkg/testing/integration_test.go +++ b/pkg/testing/integration_test.go @@ -18,12 +18,13 @@ package testing import ( - context "context" + "context" + "fmt" "os" test "testing" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -425,7 +426,7 @@ func (s *IntegrationSuite) createActionset(ctx context.Context, c *check.C, as * case err != nil, as.Status == nil: return false, err case as.Status.State == crv1alpha1.StateFailed: - return true, errors.Errorf("Actionset failed: %#v", as.Status) + return true, errkit.New(fmt.Sprintf("Actionset failed: %#v", as.Status)) case as.Status.State == crv1alpha1.StateComplete: return true, nil } diff --git a/pkg/testutil/func.go b/pkg/testutil/func.go index 8e5beabdf6..bb45370478 100644 --- a/pkg/testutil/func.go +++ b/pkg/testutil/func.go @@ -18,7 +18,7 @@ import ( "context" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kanister "github.com/kanisterio/kanister/pkg" @@ -48,7 +48,7 @@ var ( ) func failFunc(context.Context, param.TemplateParams, map[string]interface{}) (map[string]interface{}, error) { - err := errors.New("Kanister function failed") + err := errkit.New("Kanister function failed") failFuncCh <- err return nil, err } diff --git a/pkg/testutil/mockblockstorage/mockblockstorage.go b/pkg/testutil/mockblockstorage/mockblockstorage.go index d36e38e565..9275cf4a60 100644 --- a/pkg/testutil/mockblockstorage/mockblockstorage.go +++ b/pkg/testutil/mockblockstorage/mockblockstorage.go @@ -20,7 +20,7 @@ import ( "time" uuid "github.com/gofrs/uuid" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "github.com/kanisterio/kanister/pkg/blockstorage" "github.com/kanisterio/kanister/pkg/blockstorage/getter" @@ -57,7 +57,7 @@ func (*mockGetter) Get(storageType blockstorage.Type, config map[string]string) case blockstorage.TypeGPD: return Get(storageType) default: - return nil, errors.New("Get failed") + return nil, errkit.New("Get failed") } } @@ -65,7 +65,7 @@ func (*mockGetter) Get(storageType blockstorage.Type, config map[string]string) func Get(storageType blockstorage.Type) (*Provider, error) { volumeUUID, err := uuid.NewV1() if err != nil { - return nil, errors.Wrap(err, "Failed to create UUID") + return nil, errkit.Wrap(err, "Failed to create UUID") } volume := blockstorage.Volume{ Type: storageType, @@ -84,7 +84,7 @@ func Get(storageType blockstorage.Type) (*Provider, error) { snapVol := volume snapUUID, err := uuid.NewV1() if err != nil { - return nil, errors.Wrap(err, "Failed to create UUID") + return nil, errkit.Wrap(err, "Failed to create UUID") } snapshot := blockstorage.Snapshot{ Type: storageType, @@ -122,7 +122,7 @@ func (p *Provider) VolumeCreate(context.Context, blockstorage.Volume) (*blocksto func (p *Provider) VolumeCreateFromSnapshot(ctx context.Context, snapshot blockstorage.Snapshot, tags map[string]string) (*blockstorage.Volume, error) { volUUID, err := uuid.NewV1() if err != nil { - return nil, errors.Wrap(err, "Failed to create UUID") + return nil, errkit.Wrap(err, "Failed to create UUID") } vol := blockstorage.Volume{ Type: snapshot.Type, @@ -197,7 +197,7 @@ func (p *Provider) SetTags(ctx context.Context, resource interface{}, tags map[s case *blockstorage.Snapshot: return nil default: - return errors.Errorf("Unsupported resource type %v(%T)", res, res) + return errkit.New(fmt.Sprintf("Unsupported resource type %v(%T)", res, res)) } } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 55aff0c8dc..396472f324 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -56,7 +56,7 @@ func PrintStage(description string, i indicator) { func GetNamespaceUID(ctx context.Context, cli kubernetes.Interface, namespace string) (string, error) { ns, err := cli.CoreV1().Namespaces().Get(ctx, namespace, metav1.GetOptions{}) if err != nil { - return "", errors.Wrapf(err, "Failed to get namespace %s", namespace) + return "", errkit.Wrap(err, "Failed to get namespace", "namespace", namespace) } return string(ns.GetUID()), nil } @@ -85,7 +85,7 @@ func GetIntOrDefault(value string, defaultValue int) (int, error) { v, err := strconv.Atoi(value) if err != nil { v = defaultValue - return v, errors.New("conversion to integer failed, using default value for the field") + return v, errkit.New("conversion to integer failed, using default value for the field") } return v, nil } @@ -121,7 +121,7 @@ func RoundUpDuration(t time.Duration) time.Duration { func CheckRequiredArgs(reqArgs []string, args map[string]interface{}) error { for _, a := range reqArgs { if _, ok := args[a]; !ok { - return errors.Errorf("Required arg missing: %s", a) + return errkit.New(fmt.Sprintf("Required arg missing: %s", a)) } } return nil @@ -132,7 +132,7 @@ func CheckRequiredArgs(reqArgs []string, args map[string]interface{}) error { func CheckSupportedArgs(supportedArgs []string, args map[string]interface{}) error { for a := range args { if !slices.Contains(supportedArgs, a) { - return errors.Errorf("argument %s is not supported", a) + return errkit.New(fmt.Sprintf("argument %s is not supported", a)) } } return nil diff --git a/pkg/validate/error.go b/pkg/validate/error.go index 5011e94a25..50c4c591a4 100644 --- a/pkg/validate/error.go +++ b/pkg/validate/error.go @@ -15,18 +15,16 @@ package validate import ( - "fmt" - - "github.com/pkg/errors" + "github.com/kanisterio/errkit" ) -var errValidate = fmt.Errorf("Validation Failed") +var errValidate = errkit.NewSentinelErr("Validation Failed") func errorf(err error, format string, args ...interface{}) error { - return errors.Wrapf(err, format, args...) + return errkit.Wrap(err, format, args...) } -// IsError returns true iff the underlying cause was a validation error. +// IsError returns true if the underlying cause was a validation error. func IsError(err error) bool { - return errors.Cause(err) == errValidate + return errkit.Is(err, errValidate) } diff --git a/pkg/validate/error_test.go b/pkg/validate/error_test.go index 05b9cba995..cf86806870 100644 --- a/pkg/validate/error_test.go +++ b/pkg/validate/error_test.go @@ -17,7 +17,7 @@ package validate import ( "fmt" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "gopkg.in/check.v1" ) @@ -43,23 +43,23 @@ func (s *ErrorSuite) TestIsError(c *check.C) { is: true, }, { - err: errors.Wrap(nil, "test"), + err: errkit.Wrap(nil, "test"), is: false, }, { - err: errors.WithStack(nil), + err: errkit.WithStack(nil), is: false, }, { - err: errors.Wrap(errValidate, "test"), + err: errkit.Wrap(errValidate, "test"), is: true, }, { - err: errors.WithStack(errValidate), + err: errkit.WithStack(errValidate), is: true, }, { - err: errors.New("test"), + err: errkit.New("test"), is: false, }, } { diff --git a/pkg/validatingwebhook/blueprint_handler.go b/pkg/validatingwebhook/blueprint_handler.go index 4d45172c55..a015969ae9 100644 --- a/pkg/validatingwebhook/blueprint_handler.go +++ b/pkg/validatingwebhook/blueprint_handler.go @@ -18,7 +18,7 @@ type BlueprintValidator struct { func (b *BlueprintValidator) Handle(ctx context.Context, r admission.Request) admission.Response { bp := &crv1alpha1.Blueprint{} - err := b.decoder.Decode(r, bp) + err := (*b.decoder).Decode(r, bp) if err != nil { return admission.Errored(http.StatusBadRequest, err) } diff --git a/pkg/validatingwebhook/repositoryserver_handler.go b/pkg/validatingwebhook/repositoryserver_handler.go index b3b9c3509e..b401050c99 100644 --- a/pkg/validatingwebhook/repositoryserver_handler.go +++ b/pkg/validatingwebhook/repositoryserver_handler.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/pkg/errors" + "github.com/kanisterio/errkit" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -43,11 +43,11 @@ func (r *RepositoryServerValidator) ValidateUpdate(ctx context.Context, old runt oldrs, ook := old.(*crv1alpha1.RepositoryServer) newrs, nok := new.(*crv1alpha1.RepositoryServer) if !ook || !nok { - return nil, errors.New("Either updated object or the old object is not of type RepositoryServer.cr.kanister.io") + return nil, errkit.New("Either updated object or the old object is not of type RepositoryServer.cr.kanister.io") } errMsg := fmt.Sprintf("RepositoryServer.cr.kanister.io \"%s\" is invalid: spec.repository.rootPath: Invalid value, Value is immutable", newrs.Name) if oldrs.Spec.Repository.RootPath != newrs.Spec.Repository.RootPath { - return nil, errors.New(errMsg) + return nil, errkit.New(errMsg) } return nil, nil }