From 28788734864fc440ed7d1b2cfeff641be1c1b3dc Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Wed, 18 Mar 2026 11:23:25 +0530 Subject: [PATCH] upgrade dependencies, linters and controller Signed-off-by: Bala.FA --- .github/workflows/build.yml | 10 +- .github/workflows/functests.yml | 21 +- .github/workflows/linters.yml | 10 +- .github/workflows/vulncheck.yml | 6 +- .golangci.yml | 35 +-- .goreleaser.yml | 2 +- Dockerfile | 8 +- cmd/directpv/main.go | 4 +- cmd/kubectl-directpv/discover.go | 2 +- cmd/kubectl-directpv/flags.go | 12 +- cmd/kubectl-directpv/info.go | 5 +- cmd/kubectl-directpv/init.go | 2 +- cmd/kubectl-directpv/install.go | 8 +- cmd/kubectl-directpv/label.go | 2 +- cmd/kubectl-directpv/list_drives.go | 4 +- cmd/kubectl-directpv/progress_model.go | 63 +++-- cmd/kubectl-directpv/remove.go | 3 +- codegen.sh | 4 +- docs/installation.md | 8 +- docs/tools/push-images.sh | 8 +- go.mod | 102 ++++---- go.sum | 242 ++++++++++-------- pkg/admin/cordon.go | 2 +- pkg/admin/info.go | 8 +- pkg/admin/install.go | 2 +- pkg/admin/installer/args.go | 34 +-- pkg/admin/installer/daemonset.go | 2 +- pkg/admin/installer/deployment.go | 4 +- .../directpv.min.io_directpvdrives.yaml | 2 +- .../directpv.min.io_directpvinitrequests.yaml | 2 +- .../directpv.min.io_directpvnodes.yaml | 2 +- .../directpv.min.io_directpvvolumes.yaml | 2 +- pkg/admin/installer/installer.go | 2 +- pkg/admin/installer/migrate.go | 4 +- pkg/admin/migrate.go | 8 +- pkg/admin/move.go | 8 +- pkg/admin/repair.go | 3 +- pkg/admin/resume_drives.go | 2 +- pkg/admin/resume_volumes.go | 2 +- pkg/admin/suspend_drives.go | 2 +- pkg/admin/suspend_volumes.go | 2 +- pkg/admin/uncordon.go | 2 +- pkg/apis/directpv.min.io/v1beta1/drive.go | 2 +- pkg/client/drive_lister.go | 4 +- pkg/client/drive_lister_test.go | 2 +- pkg/client/init.go | 12 +- pkg/client/initrequest_lister.go | 6 +- pkg/client/node_lister.go | 6 +- pkg/client/volume_lister.go | 4 +- pkg/client/volume_lister_test.go | 2 +- pkg/controller/controller.go | 37 ++- pkg/controller/controller_test.go | 3 + pkg/csi/controller/server_test.go | 2 +- pkg/csi/node/publish_unpublish.go | 6 +- pkg/csi/node/stage_unstage_test.go | 4 +- pkg/device/probe.go | 15 +- pkg/device/sync.go | 10 +- pkg/device/sync_test.go | 40 +-- pkg/drive/event.go | 4 +- pkg/drive/repair.go | 6 +- pkg/ellipsis/ellipsis.go | 2 +- pkg/initrequest/event.go | 3 +- pkg/initrequest/reflink_linux.go | 3 +- pkg/k8s/client.go | 13 +- pkg/legacy/client/init.go | 4 +- pkg/utils/utils.go | 2 +- pkg/volume/event.go | 7 +- pkg/xfs/probe_linux.go | 3 +- pkg/xfs/quota.go | 5 +- 69 files changed, 472 insertions(+), 391 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 559dd1a96..4e68b5925 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,10 +17,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 with: - go-version: 1.24.x + go-version: 1.26.x check-latest: true - name: Set environment run: | @@ -33,8 +33,8 @@ jobs: run: | ./build.sh go test -v ./... - - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-qemu-action@v4 - name: Check Goreleaser - uses: goreleaser/goreleaser-action@v6 + uses: goreleaser/goreleaser-action@v7 with: args: release --skip=publish,sign --clean --snapshot diff --git a/.github/workflows/functests.yml b/.github/workflows/functests.yml index a981dff9f..4020dab05 100644 --- a/.github/workflows/functests.yml +++ b/.github/workflows/functests.yml @@ -20,14 +20,14 @@ jobs: timeout-minutes: 60 strategy: matrix: - kube-version: ['v1.20.15', 'v1.21.14', 'v1.22.17', 'v1.23.17', 'v1.24.17', 'v1.25.16', 'v1.26.15', 'v1.27.16', 'v1.28.15', 'v1.29.14', 'v1.30.14', 'v1.31.10', 'v1.32.6', 'v1.33.2'] + kube-version: ['v1.19.16', 'v1.20.15', 'v1.21.14', 'v1.22.17', 'v1.23.17', 'v1.24.17', 'v1.25.16', 'v1.26.15', 'v1.27.16', 'v1.28.15', 'v1.29.14', 'v1.30.14', 'v1.31.14', 'v1.32.13', 'v1.33.9', 'v1.34.5', 'v1.35.2'] os: [ubuntu-22.04, ubuntu-24.04] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 with: - go-version: 1.24.x + go-version: 1.26.x check-latest: true - name: Install dependencies @@ -51,16 +51,12 @@ jobs: go build -tags "osusergo netgo static_build" -ldflags="-X main.Version=${VERSION} -extldflags=-static" github.com/minio/directpv/cmd/directpv go build -tags "osusergo netgo static_build" -ldflags="-X main.Version=${VERSION} -extldflags=-static" github.com/minio/directpv/cmd/kubectl-directpv - - name: Build docker image - run: | - docker build --quiet -t quay.io/minio/directpv:${VERSION} . - docker build --quiet -t example.org/test/sleep:v0.0.1 -f functests/Dockerfile.sleep functests - - name: Setup Minikube uses: medyagh/setup-minikube@latest with: driver: none kubernetes-version: ${{ matrix.kube-version }} + start-args: '--force' - name: Check Minikube run: | @@ -69,6 +65,11 @@ jobs: while kubectl get pods -n kube-system --no-headers | grep -vqw Running; do echo "Waiting for Minikube pods to be ready"; sleep 3; done while kubectl get nodes --no-headers | grep -vqw Ready; do echo "Waiting for Minikube node to be ready"; sleep 3; done + - name: Build docker image + run: | + docker build --quiet -t quay.io/minio/directpv:${VERSION} . + docker build --quiet -t example.org/test/sleep:v0.0.1 -f functests/Dockerfile.sleep functests + - name: Run tests run: | functests/run-tests.sh @@ -79,7 +80,7 @@ jobs: functests/run-migration-tests.sh "v3.2.2" - name: Run migration tests with DirectCSI v2.0.9 - if: contains(fromJson('["v1.20.15", "v1.21.14", "v1.22.17"]'), matrix.kube-version) + if: contains(fromJson('["v1.19.16", "v1.20.15", "v1.21.14", "v1.22.17"]'), matrix.kube-version) run: | sudo rm -fr /var/lib/directpv /var/lib/direct-csi functests/run-migration-tests.sh "v2.0.9" diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ed52511b0..b83bfabb4 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -17,13 +17,13 @@ jobs: linters: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 with: - go-version: 1.24.x + go-version: 1.26.x check-latest: true - uses: ludeeus/action-shellcheck@master - - uses: golangci/golangci-lint-action@v8 + - uses: golangci/golangci-lint-action@v9 with: - version: v2.2.1 + version: v2.11.3 args: --config ./.golangci.yml --timeout=60m diff --git a/.github/workflows/vulncheck.yml b/.github/workflows/vulncheck.yml index 6184c6665..c044962fe 100644 --- a/.github/workflows/vulncheck.yml +++ b/.github/workflows/vulncheck.yml @@ -19,11 +19,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: 1.24.x + go-version: 1.26.x check-latest: true - name: Install govulncheck run: go install golang.org/x/vuln/cmd/govulncheck@latest diff --git a/.golangci.yml b/.golangci.yml index 3b80ea1db..3741b5664 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ version: "2" run: - go: "1.24" + go: "1.26" linters: default: none enable: @@ -15,24 +15,27 @@ linters: - unconvert - unused - usetesting + - dupword + - errorlint + - intrange + - nilnesserr + - perfsprint + - unparam settings: misspell: locale: US - exclusions: - generated: lax - rules: - - path: (.+)\.go$ - text: should have a package comment - - path: (.+)\.go$ - text: exitAfterDefer - - path: (.+)\.go$ - text: redefines-builtin-id - - path: (.+)\.go$ - text: avoid meaningless package names - paths: - - third_party$ - - builtin$ - - examples$ + staticcheck: + checks: + - all + - -ST1000 + - -SA1019 + revive: + rules: + - name: var-naming + disabled: true + gocritic: + disabled-checks: + - exitAfterDefer formatters: enable: - gofmt diff --git a/.goreleaser.yml b/.goreleaser.yml index c8f56db60..8b2735905 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,7 +17,7 @@ release: before: hooks: - - go mod tidy -compat=1.24 + - go mod tidy -compat=1.26 - go mod download builds: diff --git a/Dockerfile b/Dockerfile index 30a3cf456..87b2c69e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,15 @@ COPY LICENSE /licenses/LICENSE RUN microdnf update --nodocs -COPY AlmaLinux.repo /etc/yum.repos.d/AlmaLinux.repo +COPY AlmaLinux.repo /AlmaLinux.repo RUN \ curl -L https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/RPM-GPG-KEY-AlmaLinux -o /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux && \ - microdnf install xfsprogs --nodocs && \ + microdnf install dnf --nodocs && \ + mv /AlmaLinux.repo /etc/yum.repos.d/AlmaLinux.repo && \ + dnf --quiet --assumeyes --nodocs install xfsprogs && \ + dnf --quiet --assumeyes clean all && \ + rpm -e --nodeps dnf dnf-data gdbm gdbm-libs ima-evm-utils libcomps libevent libreport-filesystem platform-python platform-python-pip platform-python-setuptools python3-dnf python3-gpg python3-hawkey python3-libcomps python3-libdnf python3-libs python3-pip-wheel python3-rpm python3-setuptools-wheel python3-unbound rpm-build-libs tpm2-tss unbound-libs && \ microdnf clean all && \ rm -f /etc/yum.repos.d/AlmaLinux.repo diff --git a/cmd/directpv/main.go b/cmd/directpv/main.go index b733ebe28..ace81749c 100644 --- a/cmd/directpv/main.go +++ b/cmd/directpv/main.go @@ -18,8 +18,8 @@ package main import ( "context" + "errors" "flag" - "fmt" "os" "os/signal" "syscall" @@ -67,7 +67,7 @@ var mainCmd = &cobra.Command{ }, PersistentPreRunE: func(_ *cobra.Command, _ []string) error { if kubeNodeName == "" { - return fmt.Errorf("value to --kube-node-name must be provided") + return errors.New("value to --kube-node-name must be provided") } nodeID = directpvtypes.NodeID(kubeNodeName) diff --git a/cmd/kubectl-directpv/discover.go b/cmd/kubectl-directpv/discover.go index 647498129..59023cb19 100644 --- a/cmd/kubectl-directpv/discover.go +++ b/cmd/kubectl-directpv/discover.go @@ -296,7 +296,7 @@ func discoverDevices(ctx context.Context, nodes, drives []string, teaProgram *te default: } case <-ctx.Done(): - err = fmt.Errorf("unable to complete the discovery; %v", ctx.Err()) + err = fmt.Errorf("unable to complete the discovery; %w", ctx.Err()) return } } diff --git a/cmd/kubectl-directpv/flags.go b/cmd/kubectl-directpv/flags.go index fe684969a..2b1ab0153 100644 --- a/cmd/kubectl-directpv/flags.go +++ b/cmd/kubectl-directpv/flags.go @@ -145,7 +145,7 @@ func validateNodeArgs() error { for i := range nodesArgs { nodesArgs[i] = strings.TrimSpace(nodesArgs[i]) if nodesArgs[i] == "" { - return fmt.Errorf("empty node name") + return errors.New("empty node name") } result, err := ellipsis.Expand(nodesArgs[i]) if err != nil { @@ -164,7 +164,7 @@ func validateDriveNameArgs() error { for i := range drivesArgs { drivesArgs[i] = strings.TrimSpace(utils.TrimDevPrefix(drivesArgs[i])) if drivesArgs[i] == "" { - return fmt.Errorf("empty drive name") + return errors.New("empty drive name") } result, err := ellipsis.Expand(drivesArgs[i]) if err != nil { @@ -193,7 +193,7 @@ func validateDriveIDArgs() error { for i := range driveIDArgs { driveIDArgs[i] = strings.TrimSpace(driveIDArgs[i]) if driveIDArgs[i] == "" { - return fmt.Errorf("empty drive ID") + return errors.New("empty drive ID") } if !utils.IsUUID(driveIDArgs[i]) { return fmt.Errorf("invalid drive ID %v", driveIDArgs[i]) @@ -209,7 +209,7 @@ func validatePodNameArgs() error { for i := range podNameArgs { podNameArgs[i] = strings.TrimSpace(podNameArgs[i]) if podNameArgs[i] == "" { - return fmt.Errorf("empty pod name") + return errors.New("empty pod name") } result, err := ellipsis.Expand(podNameArgs[i]) if err != nil { @@ -228,7 +228,7 @@ func validatePodNSArgs() error { for i := range podNSArgs { podNSArgs[i] = strings.TrimSpace(podNSArgs[i]) if podNSArgs[i] == "" { - return fmt.Errorf("empty pod namespace") + return errors.New("empty pod namespace") } result, err := ellipsis.Expand(podNSArgs[i]) if err != nil { @@ -245,7 +245,7 @@ func validateVolumeNameArgs() error { for i := range volumeNameArgs { volumeNameArgs[i] = strings.TrimSpace(volumeNameArgs[i]) if volumeNameArgs[i] == "" { - return fmt.Errorf("empty volume name") + return errors.New("empty volume name") } } return nil diff --git a/cmd/kubectl-directpv/info.go b/cmd/kubectl-directpv/info.go index ce8dc2a10..6ee016d90 100644 --- a/cmd/kubectl-directpv/info.go +++ b/cmd/kubectl-directpv/info.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "os" + "strconv" "github.com/fatih/color" "github.com/jedib0t/go-pretty/v6/table" @@ -93,8 +94,8 @@ func infoMain(ctx context.Context) { fmt.Sprintf("%s %s", color.GreenString(dot), n), utils.IBytes(info.DriveSize), utils.IBytes(info.VolumeSize), - fmt.Sprintf("%d", info.VolumeCount), - fmt.Sprintf("%d", info.DriveCount), + strconv.Itoa(info.VolumeCount), + strconv.Itoa(info.DriveCount), }) } } diff --git a/cmd/kubectl-directpv/init.go b/cmd/kubectl-directpv/init.go index 8ac3d255b..2c88e4f81 100644 --- a/cmd/kubectl-directpv/init.go +++ b/cmd/kubectl-directpv/init.go @@ -214,7 +214,7 @@ func initDevices(ctx context.Context, initRequests []types.InitRequest, requestI default: } case <-ctx.Done(): - err = fmt.Errorf("unable to initialize devices; %v", ctx.Err()) + err = fmt.Errorf("unable to initialize devices; %w", ctx.Err()) return } } diff --git a/cmd/kubectl-directpv/install.go b/cmd/kubectl-directpv/install.go index 6f0530737..e783c722b 100644 --- a/cmd/kubectl-directpv/install.go +++ b/cmd/kubectl-directpv/install.go @@ -48,7 +48,7 @@ var ( imagePullSecrets = []string{} nodeSelector map[string]string tolerations []corev1.Toleration - k8sVersion = "1.33.0" + k8sVersion = "1.35.0" kubeVersion *version.Version legacyFlag bool declarativeFlag bool @@ -126,18 +126,18 @@ func init() { func validateInstallCmd() (err error) { nodeSelector, err = k8s.ParseNodeSelector(nodeSelectorArgs) if err != nil { - return fmt.Errorf("%v; format of '--node-selector' flag value must be [=]", err) + return fmt.Errorf("%w; format of '--node-selector' flag value must be [=]", err) } tolerations, err = k8s.ParseTolerations(tolerationArgs) if err != nil { - return fmt.Errorf("%v; format of '--tolerations' flag value must be [=value]:", err) + return fmt.Errorf("%w; format of '--tolerations' flag value must be [=value]:", err) } if err = validateOutputFormat(false); err != nil { return err } if dryRunPrinter != nil && k8sVersion != "" { if kubeVersion, err = version.ParseSemantic(k8sVersion); err != nil { - return fmt.Errorf("invalid kubernetes version %v; %v", k8sVersion, err) + return fmt.Errorf("invalid kubernetes version %v; %w", k8sVersion, err) } } return nil diff --git a/cmd/kubectl-directpv/label.go b/cmd/kubectl-directpv/label.go index 5462336be..5bbc3c1b6 100644 --- a/cmd/kubectl-directpv/label.go +++ b/cmd/kubectl-directpv/label.go @@ -84,7 +84,7 @@ func validateLabelCmdArgs(args []string) (labels []admin.Label, err error) { return nil, err } default: - return nil, fmt.Errorf("argument must be formatted k=v or k-") + return nil, errors.New("argument must be formatted k=v or k-") } labels = append(labels, label) } diff --git a/cmd/kubectl-directpv/list_drives.go b/cmd/kubectl-directpv/list_drives.go index a33dc4963..ab9454577 100644 --- a/cmd/kubectl-directpv/list_drives.go +++ b/cmd/kubectl-directpv/list_drives.go @@ -18,8 +18,8 @@ package main import ( "context" - "fmt" "os" + "strconv" "strings" "github.com/jedib0t/go-pretty/v6/table" @@ -183,7 +183,7 @@ func listDrivesMain(ctx context.Context) { volumeCount := drive.GetVolumeCount() volumes := "-" if volumeCount > 0 { - volumes = fmt.Sprintf("%v", volumeCount) + volumes = strconv.Itoa(volumeCount) } status := drive.Status.Status if drive.IsUnschedulable() { diff --git a/cmd/kubectl-directpv/progress_model.go b/cmd/kubectl-directpv/progress_model.go index da491dedc..dc80d03d4 100644 --- a/cmd/kubectl-directpv/progress_model.go +++ b/cmd/kubectl-directpv/progress_model.go @@ -17,7 +17,6 @@ package main import ( - "fmt" "strings" "time" @@ -139,37 +138,57 @@ func (m progressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } } -func (m progressModel) View() (str string) { +func (m progressModel) View() string { pad := strings.Repeat(" ", padding) - str = "\n" + + var builder strings.Builder + builder.Grow(256) + + builder.WriteString("\n") + if m.model != nil { - str = str + pad + m.model.View() + "\n\n" + builder.WriteString(pad) + builder.WriteString(m.model.View()) + builder.WriteString("\n\n") } - if !m.done { - if m.message != "" { - str += pad + fmt.Sprintf("%s \n\n", m.message) - } + + if !m.done && m.message != "" { + builder.WriteString(pad) + builder.WriteString(m.message) + builder.WriteString("\n\n") } - for i := range m.progressLogs { - if m.progressLogs[i].done { - str += pad + fmt.Sprintf("%s %s\n", color.HiYellowString(m.progressLogs[i].log), m.spinner.Style.Render(tick)) - } else { - str += pad + fmt.Sprintf("%s %s\n", color.HiYellowString(m.progressLogs[i].log), m.spinner.View()) - } - if i == len(m.progressLogs)-1 { - str += "\n" + + if len(m.progressLogs) > 0 { + for _, pl := range m.progressLogs { + builder.WriteString(pad) + builder.WriteString(color.HiYellowString(pl.log)) + builder.WriteByte(' ') + if pl.done { + builder.WriteString(m.spinner.Style.Render(tick)) + } else { + builder.WriteString(m.spinner.View()) + } + builder.WriteByte('\n') } + builder.WriteByte('\n') } - for i := range m.logs { - str += pad + color.HiYellowString(fmt.Sprintf("%s \n", m.logs[i])) - if i == len(m.logs)-1 { - str += "\n" + + if len(m.logs) > 0 { + for _, log := range m.logs { + builder.WriteString(pad) + builder.WriteString(color.HiYellowString(log)) + builder.WriteByte('\n') } + builder.WriteByte('\n') } + if m.err != nil { - str += pad + color.HiRedString("Error; %s \n\n", m.err.Error()) + builder.WriteString(pad) + builder.WriteString(color.HiRedString("Error: %s\n\n", m.err.Error())) } - return str + pad + + builder.WriteString(pad) + return builder.String() } func toProgressLogs(progressMap map[string]progressLog) (logs []progressLog) { diff --git a/cmd/kubectl-directpv/remove.go b/cmd/kubectl-directpv/remove.go index ae50d8a5b..a17ebd175 100644 --- a/cmd/kubectl-directpv/remove.go +++ b/cmd/kubectl-directpv/remove.go @@ -19,7 +19,6 @@ package main import ( "context" "errors" - "fmt" "os" "strings" @@ -30,7 +29,7 @@ import ( var removeCmd = &cobra.Command{ Use: "remove [DRIVE ...]", - Short: fmt.Sprintf("Remove unused drives from %s", consts.AppPrettyName), + Short: "Remove unused drives from " + consts.AppPrettyName, SilenceUsage: true, SilenceErrors: true, Example: strings.ReplaceAll( diff --git a/codegen.sh b/codegen.sh index dd9e4339e..97c384e02 100755 --- a/codegen.sh +++ b/codegen.sh @@ -30,8 +30,8 @@ go install -v \ k8s.io/code-generator/cmd/deepcopy-gen@v0.29.15 \ k8s.io/code-generator/cmd/client-gen@v0.29.15 \ k8s.io/code-generator/cmd/conversion-gen@v0.29.15 -go install -v k8s.io/kube-openapi/cmd/openapi-gen@v0.0.0-20250701173324-9bd5c66d9911 -go install -v sigs.k8s.io/controller-tools/cmd/controller-gen@v0.18.0 +go install k8s.io/kube-openapi/cmd/openapi-gen@v0.0.0-20260127142750-a19766b6e2d4 +go install -v sigs.k8s.io/controller-tools/cmd/controller-gen@v0.20.1 cd "$(dirname "$0")" diff --git a/docs/installation.md b/docs/installation.md index 00b1da1c8..60d37bb05 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -37,11 +37,11 @@ Before starting the installation, it is required to have DirectPV plugin install ### Prerequisites * Kubernetes >= v1.20 on GNU/Linux on amd64. * If you use private registry, below images must be pushed into your registry. You could use [this helper script](tools/push-images.sh) to do that. - - quay.io/minio/csi-node-driver-registrar:v2.12.0-0 - - quay.io/minio/csi-provisioner:v5.0.2-0 _(for Kubernetes >= v1.20)_ + - quay.io/minio/csi-node-driver-registrar:v2.16.0-0 + - quay.io/minio/csi-provisioner:v6.2.0-0 _(for Kubernetes >= v1.20)_ - quay.io/minio/csi-provisioner:v2.2.0-go1.18 _(for kubernetes < v1.20)_ - - quay.io/minio/livenessprobe:v2.14.0-0 - - quay.io/minio/csi-resizer:v1.12.0-0 + - quay.io/minio/livenessprobe:v2.18.0-0 + - quay.io/minio/csi-resizer:v2.1.0-0 - quay.io/minio/directpv:latest * If `seccomp` is enabled, load [DirectPV seccomp profile](../seccomp.json) on nodes where you want to install DirectPV and use `--seccomp-profile` flag to `kubectl directpv install` command. For more information, refer Kubernetes documentation [here](https://kubernetes.io/docs/tutorials/clusters/seccomp/) * If `apparmor` is enabled, load [DirectPV apparmor profile](../apparmor.profile) on nodes where you want to install DirectPV and use `--apparmor-profile` flag to `kubectl directpv install` command. For more information, refer to the [Kubernetes documentation](https://kubernetes.io/docs/tutorials/clusters/apparmor/). diff --git a/docs/tools/push-images.sh b/docs/tools/push-images.sh index 785f4f801..a4804f0aa 100755 --- a/docs/tools/push-images.sh +++ b/docs/tools/push-images.sh @@ -63,11 +63,11 @@ function push_image() { } function main() { - push_image "quay.io/minio/csi-node-driver-registrar:v2.12.0-0" - push_image "quay.io/minio/csi-provisioner:v5.0.2-0" + push_image "quay.io/minio/csi-node-driver-registrar:v2.16.0-0" + push_image "quay.io/minio/csi-provisioner:v6.2.0-0" push_image "quay.io/minio/csi-provisioner:v2.2.0-go1.18" - push_image "quay.io/minio/livenessprobe:v2.14.0-0" - push_image "quay.io/minio/csi-resizer:v1.12.0-0" + push_image "quay.io/minio/livenessprobe:v2.18.0-0" + push_image "quay.io/minio/csi-resizer:v2.1.0-0" release=$(curl -sfL "https://api.github.com/repos/minio/directpv/releases" | awk '/tag_name/ { print substr($2, 3, length($2)-4) }' | awk 'BEGIN{m = 0; ver=""} /^4\.0\./ { p = substr($1, 5, length($1)); if (0+p > 0+m) {m = p; ver = $1} } END{print ver}') push_image "quay.io/minio/directpv:v${release}" } diff --git a/go.mod b/go.mod index 7861dfb5f..d975e3e62 100644 --- a/go.mod +++ b/go.mod @@ -1,30 +1,28 @@ module github.com/minio/directpv -go 1.24.0 - -toolchain go1.24.4 +go 1.26.0 require ( github.com/cespare/xxhash/v2 v2.3.0 - github.com/charmbracelet/bubbles v0.21.0 - github.com/charmbracelet/bubbletea v1.3.5 + github.com/charmbracelet/bubbles v1.0.0 + github.com/charmbracelet/bubbletea v1.3.10 github.com/charmbracelet/lipgloss v1.1.0 - github.com/container-storage-interface/spec v1.11.0 + github.com/container-storage-interface/spec v1.12.0 github.com/dustin/go-humanize v1.0.1 - github.com/fatih/color v1.18.0 + github.com/fatih/color v1.19.0 github.com/freddierice/go-losetup/v2 v2.0.1 github.com/google/uuid v1.6.0 - github.com/jedib0t/go-pretty/v6 v6.6.7 + github.com/jedib0t/go-pretty/v6 v6.7.8 github.com/kubernetes-csi/csi-lib-utils v0.16.0 github.com/minio/sha256-simd v1.0.1 github.com/mitchellh/go-homedir v1.1.0 - github.com/prometheus/client_golang v1.22.0 + github.com/prometheus/client_golang v1.23.2 github.com/prometheus/client_model v0.6.2 - github.com/spf13/cobra v1.9.1 - github.com/spf13/viper v1.20.1 - golang.org/x/text v0.26.0 - golang.org/x/time v0.12.0 - google.golang.org/grpc v1.73.0 + github.com/spf13/cobra v1.10.2 + github.com/spf13/viper v1.21.0 + golang.org/x/text v0.35.0 + golang.org/x/time v0.15.0 + google.golang.org/grpc v1.79.3 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.28.15 k8s.io/apiextensions-apiserver v0.28.15 @@ -33,27 +31,40 @@ require ( k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 k8s.io/pod-security-admission v0.28.15 - sigs.k8s.io/yaml v1.5.0 + sigs.k8s.io/yaml v1.6.0 ) require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/charmbracelet/colorprofile v0.3.1 // indirect + github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/harmonica v0.2.0 // indirect - github.com/charmbracelet/x/ansi v0.9.3 // indirect - github.com/charmbracelet/x/cellbuf v0.0.13 // indirect - github.com/charmbracelet/x/term v0.2.1 // indirect + github.com/charmbracelet/x/ansi v0.11.6 // indirect + github.com/charmbracelet/x/cellbuf v0.0.15 // indirect + github.com/charmbracelet/x/term v0.2.2 // indirect + github.com/clipperhouse/displaywidth v0.11.0 // indirect + github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.2 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/evanphx/json-patch v5.9.11+incompatible // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/go-logr/logr v1.4.3 // indirect - github.com/go-openapi/jsonpointer v0.21.1 // indirect + github.com/go-openapi/jsonpointer v0.22.5 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect - github.com/go-openapi/swag v0.23.1 // indirect - github.com/go-viper/mapstructure/v2 v2.3.0 // indirect + github.com/go-openapi/swag v0.25.5 // indirect + github.com/go-openapi/swag/cmdutils v0.25.5 // indirect + github.com/go-openapi/swag/conv v0.25.5 // indirect + github.com/go-openapi/swag/fileutils v0.25.5 // indirect + github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/go-openapi/swag/jsonutils v0.25.5 // indirect + github.com/go-openapi/swag/loading v0.25.5 // indirect + github.com/go-openapi/swag/mangling v0.25.5 // indirect + github.com/go-openapi/swag/netutils v0.25.5 // indirect + github.com/go-openapi/swag/stringutils v0.25.5 // indirect + github.com/go-openapi/swag/typeutils v0.25.5 // indirect + github.com/go-openapi/swag/yamlutils v0.25.5 // indirect + github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -62,47 +73,42 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.11 // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mailru/easyjson v0.9.0 // indirect + github.com/klauspost/cpuid/v2 v2.3.0 // indirect + github.com/lucasb-eyer/go-colorful v1.3.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mattn/go-runewidth v0.0.21 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/prometheus/common v0.65.0 // indirect - github.com/prometheus/procfs v0.17.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/common v0.67.5 // indirect + github.com/prometheus/procfs v0.20.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/sagikazarmark/locafero v0.9.0 // indirect - github.com/sourcegraph/conc v0.3.0 // indirect - github.com/spf13/afero v1.14.0 // indirect - github.com/spf13/cast v1.9.2 // indirect - github.com/spf13/pflag v1.0.6 // indirect + github.com/sagikazarmark/locafero v0.12.0 // indirect + github.com/spf13/afero v1.15.0 // indirect + github.com/spf13/cast v1.10.0 // indirect + github.com/spf13/pflag v1.0.10 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - go.uber.org/multierr v1.11.0 // indirect - go.yaml.in/yaml/v2 v2.4.2 // indirect - go.yaml.in/yaml/v3 v3.0.3 // indirect - golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect - golang.org/x/net v0.41.0 // indirect - golang.org/x/oauth2 v0.30.0 // indirect - golang.org/x/sync v0.15.0 // indirect - golang.org/x/sys v0.33.0 // indirect - golang.org/x/term v0.32.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect - google.golang.org/protobuf v1.36.6 // indirect + go.yaml.in/yaml/v2 v2.4.4 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.52.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sys v0.42.0 // indirect + golang.org/x/term v0.41.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/inf.v0 v0.9.1 // indirect k8s.io/component-base v0.28.15 // indirect - k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect - sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect + k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect ) diff --git a/go.sum b/go.sum index 7ebfb756e..f85c54fc8 100644 --- a/go.sum +++ b/go.sum @@ -4,24 +4,28 @@ 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/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs= -github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg= -github.com/charmbracelet/bubbletea v1.3.5 h1:JAMNLTbqMOhSwoELIr0qyP4VidFq72/6E9j7HHmRKQc= -github.com/charmbracelet/bubbletea v1.3.5/go.mod h1:TkCnmH+aBd4LrXhXcqrKiYwRs7qyQx5rBgH5fVY3v54= -github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40= -github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0= +github.com/charmbracelet/bubbles v1.0.0 h1:12J8/ak/uCZEMQ6KU7pcfwceyjLlWsDLAxB5fXonfvc= +github.com/charmbracelet/bubbles v1.0.0/go.mod h1:9d/Zd5GdnauMI5ivUIVisuEm3ave1XwXtD1ckyV6r3E= +github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw= +github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4= +github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q= +github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= -github.com/charmbracelet/x/ansi v0.9.3 h1:BXt5DHS/MKF+LjuK4huWrC6NCvHtexww7dMayh6GXd0= -github.com/charmbracelet/x/ansi v0.9.3/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE= -github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k= -github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= -github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= -github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= -github.com/container-storage-interface/spec v1.11.0 h1:H/YKTOeUZwHtyPOr9raR+HgFmGluGCklulxDYxSdVNM= -github.com/container-storage-interface/spec v1.11.0/go.mod h1:DtUvaQszPml1YJfIK7c00mlv6/g4wNMLanLgiUbKFRI= +github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8= +github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= +github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= +github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= +github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= +github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= +github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= +github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= +github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= +github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= +github.com/container-storage-interface/spec v1.12.0 h1:zrFOEqpR5AghNaaDG4qyedwPBqU2fU0dWjLQMP/azK0= +github.com/container-storage-interface/spec v1.12.0/go.mod h1:txsm+MA2B2WDa5kW69jNbqPnvTtfvZma7T/zsAZ9qX8= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -35,8 +39,8 @@ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6 github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/freddierice/go-losetup/v2 v2.0.1 h1:wPDx/Elu9nDV8y/CvIbEDz5Xi5Zo80y4h7MKbi3XaAI= @@ -47,17 +51,45 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/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-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic= -github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk= +github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= +github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= -github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU= -github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0= +github.com/go-openapi/swag v0.25.5 h1:pNkwbUEeGwMtcgxDr+2GBPAk4kT+kJ+AaB+TMKAg+TU= +github.com/go-openapi/swag v0.25.5/go.mod h1:B3RT6l8q7X803JRxa2e59tHOiZlX1t8viplOcs9CwTA= +github.com/go-openapi/swag/cmdutils v0.25.5 h1:yh5hHrpgsw4NwM9KAEtaDTXILYzdXh/I8Whhx9hKj7c= +github.com/go-openapi/swag/cmdutils v0.25.5/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.5 h1:wAXBYEXJjoKwE5+vc9YHhpQOFj2JYBMF2DUi+tGu97g= +github.com/go-openapi/swag/conv v0.25.5/go.mod h1:CuJ1eWvh1c4ORKx7unQnFGyvBbNlRKbnRyAvDvzWA4k= +github.com/go-openapi/swag/fileutils v0.25.5 h1:B6JTdOcs2c0dBIs9HnkyTW+5gC+8NIhVBUwERkFhMWk= +github.com/go-openapi/swag/fileutils v0.25.5/go.mod h1:V3cT9UdMQIaH4WiTrUc9EPtVA4txS0TOmRURmhGF4kc= +github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= +github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/swag/jsonutils v0.25.5 h1:XUZF8awQr75MXeC+/iaw5usY/iM7nXPDwdG3Jbl9vYo= +github.com/go-openapi/swag/jsonutils v0.25.5/go.mod h1:48FXUaz8YsDAA9s5AnaUvAmry1UcLcNVWUjY42XkrN4= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5 h1:SX6sE4FrGb4sEnnxbFL/25yZBb5Hcg1inLeErd86Y1U= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.5/go.mod h1:/2KvOTrKWjVA5Xli3DZWdMCZDzz3uV/T7bXwrKWPquo= +github.com/go-openapi/swag/loading v0.25.5 h1:odQ/umlIZ1ZVRteI6ckSrvP6e2w9UTF5qgNdemJHjuU= +github.com/go-openapi/swag/loading v0.25.5/go.mod h1:I8A8RaaQ4DApxhPSWLNYWh9NvmX2YKMoB9nwvv6oW6g= +github.com/go-openapi/swag/mangling v0.25.5 h1:hyrnvbQRS7vKePQPHHDso+k6CGn5ZBs5232UqWZmJZw= +github.com/go-openapi/swag/mangling v0.25.5/go.mod h1:6hadXM/o312N/h98RwByLg088U61TPGiltQn71Iw0NY= +github.com/go-openapi/swag/netutils v0.25.5 h1:LZq2Xc2QI8+7838elRAaPCeqJnHODfSyOa7ZGfxDKlU= +github.com/go-openapi/swag/netutils v0.25.5/go.mod h1:lHbtmj4m57APG/8H7ZcMMSWzNqIQcu0RFiXrPUara14= +github.com/go-openapi/swag/stringutils v0.25.5 h1:NVkoDOA8YBgtAR/zvCx5rhJKtZF3IzXcDdwOsYzrB6M= +github.com/go-openapi/swag/stringutils v0.25.5/go.mod h1:PKK8EZdu4QJq8iezt17HM8RXnLAzY7gW0O1KKarrZII= +github.com/go-openapi/swag/typeutils v0.25.5 h1:EFJ+PCga2HfHGdo8s8VJXEVbeXRCYwzzr9u4rJk7L7E= +github.com/go-openapi/swag/typeutils v0.25.5/go.mod h1:itmFmScAYE1bSD8C4rS0W+0InZUBrB2xSPbWt6DLGuc= +github.com/go-openapi/swag/yamlutils v0.25.5 h1:kASCIS+oIeoc55j28T4o8KwlV2S4ZLPT6G0iq2SSbVQ= +github.com/go-openapi/swag/yamlutils v0.25.5/go.mod h1:Gek1/SjjfbYvM+Iq4QGwa/2lEXde9n2j4a3wI3pNuOQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.0 h1:7SgOMTvJkM8yWrQlU8Jm18VeDPuAvB/xWrdxFJkoFag= +github.com/go-openapi/testify/enable/yaml/v2 v2.4.0/go.mod h1:14iV8jyyQlinc9StD7w1xVPW3CO3q1Gj04Jy//Kw4VM= +github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= +github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= -github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= +github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= @@ -80,18 +112,16 @@ github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jedib0t/go-pretty/v6 v6.6.7 h1:m+LbHpm0aIAPLzLbMfn8dc3Ht8MW7lsSO4MPItz/Uuo= -github.com/jedib0t/go-pretty/v6 v6.6.7/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jedib0t/go-pretty/v6 v6.7.8 h1:BVYrDy5DPBA3Qn9ICT+PokP9cvCv1KaHv2i+Hc8sr5o= +github.com/jedib0t/go-pretty/v6 v6.7.8/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/klauspost/cpuid/v2 v2.2.11 h1:0OwqZRYI2rFrjS4kvkDnqJkKHdHaRnCm68/DY4OxRzU= -github.com/klauspost/cpuid/v2 v2.2.11/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= +github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -100,18 +130,16 @@ github.com/kubernetes-csi/csi-lib-utils v0.16.0 h1:LXCvkhXHtFOkl7LoDqFdho/Muebcc github.com/kubernetes-csi/csi-lib-utils v0.16.0/go.mod h1:fp1Oik+45tP2o4X9SD/SBWXLTQYT9wtLxGasBE3+vBI= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= -github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag= +github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= -github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= -github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.21 h1:jJKAZiQH+2mIinzCJIaIG9Be1+0NR+5sz/lYEEjdM8w= +github.com/mattn/go-runewidth v0.0.21/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -119,8 +147,9 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= @@ -135,115 +164,114 @@ github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= -github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= -github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE= -github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8= -github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0= -github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= +github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= +github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= +github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k= -github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= -github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= -github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE= -github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= -github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= -github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= -github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= -github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4= +github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= +github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= +github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= +github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= +github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= +github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= -go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= -go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= -go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= -go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= -go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= -go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= -go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= -go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= -go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= -go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= -go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE= -go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= +go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o= -golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= -golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= -golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= -golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= -golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= +golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= -golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 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.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= -golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= +golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= +golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= -google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 h1:ndE4FoJqsIceKP2oYSnUZqhTdYufCYYkqwtFzfrhI7w= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= +google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -267,15 +295,15 @@ k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 h1:gAXU86Fmbr/ktY17lkHwSj k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911/go.mod h1:GLOk5B+hDbRROvt0X2+hqX64v/zO3vXN7J78OUmBSKw= k8s.io/pod-security-admission v0.28.15 h1:mYWmkuuSVe8oeca/ukz93AFNrbtDqIrdZY8Lml9Rlzw= k8s.io/pod-security-admission v0.28.15/go.mod h1:uW3MBWP6KQeqy3cJYyfFjaFOMogX4Ivw0slU8BmLIWM= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y= -k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= -sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbeZuxoSGOX/J+aYM= +k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI= sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= -sigs.k8s.io/yaml v1.5.0 h1:M10b2U7aEUY6hRtU870n2VTPgR5RZiL/I6Lcc2F4NUQ= -sigs.k8s.io/yaml v1.5.0/go.mod h1:wZs27Rbxoai4C0f8/9urLZtZtF3avA3gKvGyPdDqTO4= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/pkg/admin/cordon.go b/pkg/admin/cordon.go index 533ad598d..a7a08ae07 100644 --- a/pkg/admin/cordon.go +++ b/pkg/admin/cordon.go @@ -86,7 +86,7 @@ func (client *Client) Cordon(ctx context.Context, args CordonArgs, log LogFunc) result.Drive.Unschedulable() if !args.DryRun { if _, err = client.Drive().Update(ctx, &result.Drive, metav1.UpdateOptions{}); err != nil { - err = fmt.Errorf("unable to cordon drive %v; %v", result.Drive.GetDriveID(), err) + err = fmt.Errorf("unable to cordon drive %v; %w", result.Drive.GetDriveID(), err) return } } diff --git a/pkg/admin/info.go b/pkg/admin/info.go index b746d209a..1fcfec5d4 100644 --- a/pkg/admin/info.go +++ b/pkg/admin/info.go @@ -37,7 +37,7 @@ type NodeLevelInfo struct { func (client *Client) Info(ctx context.Context) (map[string]NodeLevelInfo, error) { crds, err := client.CRD().List(ctx, metav1.ListOptions{}) if err != nil { - return nil, fmt.Errorf("unable to list CRDs; %v", err) + return nil, fmt.Errorf("unable to list CRDs; %w", err) } drivesFound := false volumesFound := false @@ -54,18 +54,18 @@ func (client *Client) Info(ctx context.Context) (map[string]NodeLevelInfo, error } nodeList, err := client.K8s().GetCSINodes(ctx) if err != nil { - return nil, fmt.Errorf("unable to get CSI nodes; %v", err) + return nil, fmt.Errorf("unable to get CSI nodes; %w", err) } if len(nodeList) == 0 { return nil, fmt.Errorf("%v not installed", consts.AppPrettyName) } drives, err := client.NewDriveLister().Get(ctx) if err != nil { - return nil, fmt.Errorf("unable to get drive list; %v", err) + return nil, fmt.Errorf("unable to get drive list; %w", err) } volumes, err := client.NewVolumeLister().Get(ctx) if err != nil { - return nil, fmt.Errorf("unable to get volume list; %v", err) + return nil, fmt.Errorf("unable to get volume list; %w", err) } nodeInfo := make(map[string]NodeLevelInfo, len(nodeList)) for _, n := range nodeList { diff --git a/pkg/admin/install.go b/pkg/admin/install.go index 0e5b03f1a..48a97894e 100644 --- a/pkg/admin/install.go +++ b/pkg/admin/install.go @@ -125,7 +125,7 @@ func (client *Client) Install(ctx context.Context, args InstallArgs, installerTa } if installerArgs.KubeVersion == nil { // default higher version - if installerArgs.KubeVersion, err = versionpkg.ParseSemantic("1.33.0"); err != nil { + if installerArgs.KubeVersion, err = versionpkg.ParseSemantic("1.35.0"); err != nil { klog.Fatalf("this should not happen; %v", err) } } diff --git a/pkg/admin/installer/args.go b/pkg/admin/installer/args.go index 91f680744..dfde92849 100644 --- a/pkg/admin/installer/args.go +++ b/pkg/admin/installer/args.go @@ -30,25 +30,25 @@ import ( ) const ( - // csiProvisionerImage = csi-provisioner:v5.0.2-0 - csiProvisionerImage = "csi-provisioner@sha256:fc1f992dd5591357fa123c396aaadaea5033f312b9c136a11d62cf698474bebb" + // csiProvisionerImage = csi-provisioner:v6.2.0-0 + csiProvisionerImage = "csi-provisioner@sha256:f83e880ce4290b1ef4fa15a588138eafecdb40106208a5295c0b24d03cbaddbd" // csiProvisionerImageV2_2_0 = csi-provisioner:v2.2.0-go1.18 csiProvisionerImageV2_2_0 = "csi-provisioner@sha256:c185db49ba02c384633165894147f8d7041b34b173e82a49d7145e50e809b8d6" - // nodeDriverRegistrarImage = csi-node-driver-registrar:v2.12.0-0 - nodeDriverRegistrarImage = "csi-node-driver-registrar@sha256:dafc7f667aa2e20d7f059c20db02dd6987c2624d64d8f166cd5930721be98ea9" - // livenessProbeImage = livenessprobe:v2.14.0-0 - livenessProbeImage = "livenessprobe@sha256:783010e10e4d74b6b2b157a4b52772c5a264fd76bb2ad671054b8c3f706c8324" - // csiResizerImage = csi-resizer:v1.12.0-0 - csiResizerImage = "csi-resizer@sha256:58fa627393f20892b105a137d27e236dfaec233a3a64980f84dcb15f38c21533" - - // openshiftCSIProvisionerImage = openshift4/ose-csi-external-provisioner-rhel8:v4.12.0-202407151105.p0.g3aa7c52.assembly.stream.el8 - openshiftCSIProvisionerImage = "registry.redhat.io/openshift4/ose-csi-external-provisioner-rhel8@sha256:8bf8aa8975790e19ba107fd58699f98389e3fb692d192f4df3078fff7f0a4bba" - // openshiftNodeDriverRegistrarImage = openshift4/ose-csi-node-driver-registrar-rhel8:v4.12.0-202407151105.p0.gc316b89.assembly.stream.el8 - openshiftNodeDriverRegistrarImage = "registry.redhat.io/openshift4/ose-csi-node-driver-registrar-rhel8@sha256:ab54e6a2e8a6a1ca2da5aaf25f784c09f5bf22ea32224ec1bdb6c564f88695a9" - // openshiftLivenessProbeImage = openshift4/ose-csi-livenessprobe-rhel8:v4.12.0-202407151105.p0.ge6545e7.assembly.stream.el8 - openshiftLivenessProbeImage = "registry.redhat.io/openshift4/ose-csi-livenessprobe-rhel8@sha256:b28029f929fe2a28e666910d1acc57c3474fabdb2f9129688ef1ca56c7231d90" - // openshiftCSIResizerImage = openshift4/ose-csi-external-resizer-rhel8:v4.12.0-202407151105.p0.g5b066ba.assembly.stream.el8 - openshiftCSIResizerImage = "registry.redhat.io/openshift4/ose-csi-external-resizer-rhel8@sha256:bed8de36bac80108909205342b2d92e4de5adbfa33bf13f9346236fca52a0d3e" + // nodeDriverRegistrarImage = csi-node-driver-registrar:v2.16.0-0 + nodeDriverRegistrarImage = "csi-node-driver-registrar@sha256:183b3ac969d133457595fa2abfd9d81d20e83a6bc4606375662d036f56462dde" + // livenessProbeImage = livenessprobe:v2.18.0-0 + livenessProbeImage = "livenessprobe@sha256:af8bac7b24bbfcc064e58d45c1c2ebaf75b9ac71315a604e0870100fa6aed8da" + // csiResizerImage = csi-resizer:v2.1.0-0 + csiResizerImage = "csi-resizer@sha256:cb338f5c5a9f781f289b6f25fedebbeeb4eec9fda2aeb2c0a1eaa8529c4c9738" + + // openshiftCSIProvisionerImage = registry.redhat.io/openshift4/ose-csi-external-provisioner-rhel8:v4.15 + openshiftCSIProvisionerImage = "registry.redhat.io/openshift4/ose-csi-external-provisioner-rhel8@sha256:ecf86bed1b174e57b9b52ebf5c2792da25d7ab2daccef15bdac98a47aa09ff3e" + // openshiftNodeDriverRegistrarImage = registry.redhat.io/openshift4/ose-csi-node-driver-registrar-rhel8:v4.15 + openshiftNodeDriverRegistrarImage = "registry.redhat.io/openshift4/ose-csi-node-driver-registrar-rhel8@sha256:b61fcc8774f2dde2ed46df52630b495ff8f5bb53a80a4733006b0197297b0264" + // openshiftLivenessProbeImage = registry.redhat.io/openshift4/ose-csi-livenessprobe-rhel8:v4.15 + openshiftLivenessProbeImage = "registry.redhat.io/openshift4/ose-csi-livenessprobe-rhel8@sha256:a516448355b6c360953151ed14c1b9eaf977a674a9ff65216d3076ddc9355987" + // openshiftCSIResizerImage = registry.redhat.io/openshift4/ose-csi-external-resizer-rhel8:v4.15 + openshiftCSIResizerImage = "registry.redhat.io/openshift4/ose-csi-external-resizer-rhel8@sha256:370f6a90b4792ac9275b355f17b457c8348d3230fd2d272c8a447513ba3473b8" ) // Args represents DirectPV installation arguments. diff --git a/pkg/admin/installer/daemonset.go b/pkg/admin/installer/daemonset.go index 627b11225..6ea702a78 100644 --- a/pkg/admin/installer/daemonset.go +++ b/pkg/admin/installer/daemonset.go @@ -250,7 +250,7 @@ func (t daemonsetTask) doCreateDaemonset(ctx context.Context, args *Args) (err e containerArgs := []string{ consts.NodeServerName, fmt.Sprintf("-v=%d", logLevel), - fmt.Sprintf("--identity=%s", consts.Identity), + "--identity=" + consts.Identity, fmt.Sprintf("--csi-endpoint=$(%s)", csiEndpointEnvVarName), fmt.Sprintf("--kube-node-name=$(%s)", kubeNodeNameEnvVarName), fmt.Sprintf("--readiness-port=%d", consts.ReadinessPort), diff --git a/pkg/admin/installer/deployment.go b/pkg/admin/installer/deployment.go index 429993a52..dff985f6a 100644 --- a/pkg/admin/installer/deployment.go +++ b/pkg/admin/installer/deployment.go @@ -68,7 +68,7 @@ func (t deploymentTask) Delete(ctx context.Context, _ *Args) error { func (t deploymentTask) doCreateDeployment(ctx context.Context, args *Args, legacy bool, step int) (err error) { name := consts.ControllerServerName - containerArgs := []string{name, fmt.Sprintf("--identity=%s", consts.Identity)} + containerArgs := []string{name, "--identity=" + consts.Identity} if legacy { name = consts.LegacyControllerServerName containerArgs = []string{name} @@ -99,7 +99,7 @@ func (t deploymentTask) doCreateDeployment(ctx context.Context, args *Args, lega Volumes: []corev1.Volume{ k8s.NewHostPathVolume( csiDirVolumeName, - newPluginsSocketDir(kubeletDirPath, fmt.Sprintf("%s-controller", consts.ControllerServerName)), + newPluginsSocketDir(kubeletDirPath, consts.ControllerServerName+"-controller"), ), }, ImagePullSecrets: args.getImagePullSecrets(), diff --git a/pkg/admin/installer/directpv.min.io_directpvdrives.yaml b/pkg/admin/installer/directpv.min.io_directpvdrives.yaml index 164607fa3..05e5d8503 100644 --- a/pkg/admin/installer/directpv.min.io_directpvdrives.yaml +++ b/pkg/admin/installer/directpv.min.io_directpvdrives.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.18.0 + controller-gen.kubebuilder.io/version: v0.20.1 name: directpvdrives.directpv.min.io spec: group: directpv.min.io diff --git a/pkg/admin/installer/directpv.min.io_directpvinitrequests.yaml b/pkg/admin/installer/directpv.min.io_directpvinitrequests.yaml index 2b1507431..58ed48126 100644 --- a/pkg/admin/installer/directpv.min.io_directpvinitrequests.yaml +++ b/pkg/admin/installer/directpv.min.io_directpvinitrequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.18.0 + controller-gen.kubebuilder.io/version: v0.20.1 name: directpvinitrequests.directpv.min.io spec: group: directpv.min.io diff --git a/pkg/admin/installer/directpv.min.io_directpvnodes.yaml b/pkg/admin/installer/directpv.min.io_directpvnodes.yaml index 6684a2f9c..46beef119 100644 --- a/pkg/admin/installer/directpv.min.io_directpvnodes.yaml +++ b/pkg/admin/installer/directpv.min.io_directpvnodes.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.18.0 + controller-gen.kubebuilder.io/version: v0.20.1 name: directpvnodes.directpv.min.io spec: group: directpv.min.io diff --git a/pkg/admin/installer/directpv.min.io_directpvvolumes.yaml b/pkg/admin/installer/directpv.min.io_directpvvolumes.yaml index e2ceca18b..ac1b7848b 100644 --- a/pkg/admin/installer/directpv.min.io_directpvvolumes.yaml +++ b/pkg/admin/installer/directpv.min.io_directpvvolumes.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.18.0 + controller-gen.kubebuilder.io/version: v0.20.1 name: directpvvolumes.directpv.min.io spec: group: directpv.min.io diff --git a/pkg/admin/installer/installer.go b/pkg/admin/installer/installer.go index de9614cb2..511d26abc 100644 --- a/pkg/admin/installer/installer.go +++ b/pkg/admin/installer/installer.go @@ -62,7 +62,7 @@ func Install(ctx context.Context, args *Args, tasks []Task) (err error) { if args.KubeVersion.Major() != 1 || args.KubeVersion.Minor() < 18 || - args.KubeVersion.Minor() > 30 { + args.KubeVersion.Minor() > 35 { if !args.DryRun { utils.Eprintf( args.Quiet, diff --git a/pkg/admin/installer/migrate.go b/pkg/admin/installer/migrate.go index 8b3b1a83a..1fe79630f 100644 --- a/pkg/admin/installer/migrate.go +++ b/pkg/admin/installer/migrate.go @@ -89,7 +89,7 @@ func (t migrateTask) migrateDrives(ctx context.Context, dryRun bool, progressCh for result := range t.legacyClient.ListDrives(ctx) { if result.Err != nil { return nil, legacyDriveErrors, driveErrors, fmt.Errorf( - "unable to get legacy drives; %v", result.Err, + "unable to get legacy drives; %w", result.Err, ) } @@ -231,7 +231,7 @@ func (t migrateTask) migrateVolumes(ctx context.Context, driveMap map[string]str for result := range t.legacyClient.ListVolumes(ctx) { if result.Err != nil { return legacyVolumeErrors, volumeErrors, fmt.Errorf( - "unable to get legacy volumes; %v", result.Err, + "unable to get legacy volumes; %w", result.Err, ) } diff --git a/pkg/admin/migrate.go b/pkg/admin/migrate.go index 96977a75d..7b7c610f0 100644 --- a/pkg/admin/migrate.go +++ b/pkg/admin/migrate.go @@ -46,13 +46,13 @@ func (client *Client) Migrate(ctx context.Context, args MigrateArgs) error { } legacyClient, err := legacyclient.NewClient(client.K8s()) if err != nil { - return fmt.Errorf("unable to create legacy client; %v", err) + return fmt.Errorf("unable to create legacy client; %w", err) } if err := installer.Migrate(ctx, &installer.Args{ Quiet: args.Quiet, Legacy: true, }, client.Client, legacyClient); err != nil { - return fmt.Errorf("migration failed; %v", err) + return fmt.Errorf("migration failed; %w", err) } if !args.Quiet { fmt.Println("Migration successful; Please restart the pods in '" + consts.AppName + "' namespace.") @@ -62,14 +62,14 @@ func (client *Client) Migrate(ctx context.Context, args MigrateArgs) error { } backupCreated, err := legacyClient.RemoveAllDrives(ctx, args.DrivesBackupFile) if err != nil { - return fmt.Errorf("unable to remove legacy drive CRDs; %v", err) + return fmt.Errorf("unable to remove legacy drive CRDs; %w", err) } if backupCreated && !args.Quiet { fmt.Println("Legacy drive CRDs backed up to", args.DrivesBackupFile) } backupCreated, err = legacyClient.RemoveAllVolumes(ctx, args.VolumesBackupFile) if err != nil { - return fmt.Errorf("unable to remove legacy volume CRDs; %v", err) + return fmt.Errorf("unable to remove legacy volume CRDs; %w", err) } if backupCreated && !args.Quiet { fmt.Println("Legacy volume CRDs backed up to", args.VolumesBackupFile) diff --git a/pkg/admin/move.go b/pkg/admin/move.go index ddca70cde..9befed94e 100644 --- a/pkg/admin/move.go +++ b/pkg/admin/move.go @@ -45,7 +45,7 @@ func (client *Client) Move(ctx context.Context, args MoveArgs, log LogFunc) erro srcDrive, err := client.Drive().Get(ctx, string(args.Source), metav1.GetOptions{}) if err != nil { - return fmt.Errorf("unable to get source drive; %v", err) + return fmt.Errorf("unable to get source drive; %w", err) } if !srcDrive.IsUnschedulable() { @@ -76,7 +76,7 @@ func (client *Client) Move(ctx context.Context, args MoveArgs, log LogFunc) erro destDrive, err := client.Drive().Get(ctx, string(args.Destination), metav1.GetOptions{}) if err != nil { - return fmt.Errorf("unable to get destination drive %v; %v", args.Destination, err) + return fmt.Errorf("unable to get destination drive %v; %w", args.Destination, err) } if destDrive.GetNodeID() != srcDrive.GetNodeID() { return fmt.Errorf("source and destination drives must be in same node; source node %v; desination node %v", @@ -113,7 +113,7 @@ func (client *Client) Move(ctx context.Context, args MoveArgs, log LogFunc) erro ctx, destDrive, metav1.UpdateOptions{TypeMeta: types.NewDriveTypeMeta()}, ) if err != nil { - return fmt.Errorf("unable to move volumes to destination drive; %v", err) + return fmt.Errorf("unable to move volumes to destination drive; %w", err) } for _, volume := range volumes { @@ -132,7 +132,7 @@ func (client *Client) Move(ctx context.Context, args MoveArgs, log LogFunc) erro ctx, srcDrive, metav1.UpdateOptions{TypeMeta: types.NewDriveTypeMeta()}, ) if err != nil { - return fmt.Errorf("unable to remove volume references in source drive; %v", err) + return fmt.Errorf("unable to remove volume references in source drive; %w", err) } return nil } diff --git a/pkg/admin/repair.go b/pkg/admin/repair.go index 94c47e205..fad4eac36 100644 --- a/pkg/admin/repair.go +++ b/pkg/admin/repair.go @@ -18,6 +18,7 @@ package admin import ( "context" + "errors" "fmt" directpvtypes "github.com/minio/directpv/pkg/apis/directpv.min.io/types" @@ -82,7 +83,7 @@ func (client *Client) getContainerParams(ctx context.Context) (params repairCont } if daemonSet == nil || daemonSet.UID == "" { - return params, fmt.Errorf("invalid daemonset found") + return params, errors.New("invalid daemonset found") } for _, container := range daemonSet.Spec.Template.Spec.Containers { diff --git a/pkg/admin/resume_drives.go b/pkg/admin/resume_drives.go index afd00b826..69bcad15e 100644 --- a/pkg/admin/resume_drives.go +++ b/pkg/admin/resume_drives.go @@ -72,7 +72,7 @@ func (client *Client) ResumeDrives(ctx context.Context, args ResumeDriveArgs, lo return nil } if err = retry.RetryOnConflict(retry.DefaultRetry, updateFunc); err != nil { - err = fmt.Errorf("unable to resume drive %v; %v", result.Drive.GetDriveID(), err) + err = fmt.Errorf("unable to resume drive %v; %w", result.Drive.GetDriveID(), err) return } diff --git a/pkg/admin/resume_volumes.go b/pkg/admin/resume_volumes.go index 93a994b65..9779a199d 100644 --- a/pkg/admin/resume_volumes.go +++ b/pkg/admin/resume_volumes.go @@ -75,7 +75,7 @@ func (client *Client) ResumeVolumes(ctx context.Context, args ResumeVolumeArgs, } if err = retry.RetryOnConflict(retry.DefaultRetry, updateFunc); err != nil { - err = fmt.Errorf("unable to resume volume %v; %v", result.Volume.Name, err) + err = fmt.Errorf("unable to resume volume %v; %w", result.Volume.Name, err) return } diff --git a/pkg/admin/suspend_drives.go b/pkg/admin/suspend_drives.go index 885955555..58e82d173 100644 --- a/pkg/admin/suspend_drives.go +++ b/pkg/admin/suspend_drives.go @@ -86,7 +86,7 @@ func (client *Client) SuspendDrives(ctx context.Context, args SuspendDriveArgs, return nil } if err = retry.RetryOnConflict(retry.DefaultRetry, updateFunc); err != nil { - err = fmt.Errorf("unable to suspend drive %v; %v", result.Drive.GetDriveID(), err) + err = fmt.Errorf("unable to suspend drive %v; %w", result.Drive.GetDriveID(), err) return } diff --git a/pkg/admin/suspend_volumes.go b/pkg/admin/suspend_volumes.go index bb25ba30b..992bf5e42 100644 --- a/pkg/admin/suspend_volumes.go +++ b/pkg/admin/suspend_volumes.go @@ -83,7 +83,7 @@ func (client *Client) SuspendVolumes(ctx context.Context, args SuspendVolumeArgs return nil } if err = retry.RetryOnConflict(retry.DefaultRetry, updateFunc); err != nil { - err = fmt.Errorf("unable to suspend volume %v; %v", result.Volume.Name, err) + err = fmt.Errorf("unable to suspend volume %v; %w", result.Volume.Name, err) return } diff --git a/pkg/admin/uncordon.go b/pkg/admin/uncordon.go index 3237a5c34..54af67101 100644 --- a/pkg/admin/uncordon.go +++ b/pkg/admin/uncordon.go @@ -64,7 +64,7 @@ func (client *Client) Uncordon(ctx context.Context, args UncordonArgs, log LogFu _, err = client.Drive().Update(ctx, &result.Drive, metav1.UpdateOptions{}) } if err != nil { - err = fmt.Errorf("unable to uncordon drive %v; %v", result.Drive.GetDriveID(), err) + err = fmt.Errorf("unable to uncordon drive %v; %w", result.Drive.GetDriveID(), err) return } diff --git a/pkg/apis/directpv.min.io/v1beta1/drive.go b/pkg/apis/directpv.min.io/v1beta1/drive.go index ab0cc753f..c0ca06ffa 100644 --- a/pkg/apis/directpv.min.io/v1beta1/drive.go +++ b/pkg/apis/directpv.min.io/v1beta1/drive.go @@ -284,7 +284,7 @@ func (drive *DirectPVDrive) SetIOErrorCondition() { drive.setErrorCondition(string(types.DriveConditionTypeIOError), string(types.DriveConditionReasonIOError), string(types.DriveConditionMessageIOError)) } -// SetRelabelErrorCondition sets relabel error error condition to this drive. +// SetRelabelErrorCondition sets relabel error condition to this drive. func (drive *DirectPVDrive) SetRelabelErrorCondition(message string) { drive.setErrorCondition(string(types.DriveConditionTypeRelabelError), string(types.DriveConditionReasonRelabelError), message) } diff --git a/pkg/client/drive_lister.go b/pkg/client/drive_lister.go index 20f6d4486..8cf3726a9 100644 --- a/pkg/client/drive_lister.go +++ b/pkg/client/drive_lister.go @@ -47,10 +47,10 @@ type DriveLister struct { } // NewDriveLister creates new drive lister. -func (client Client) NewDriveLister() *DriveLister { +func (c Client) NewDriveLister() *DriveLister { return &DriveLister{ maxObjects: k8s.MaxThreadCount, - driveClient: client.Drive(), + driveClient: c.Drive(), } } diff --git a/pkg/client/drive_lister_test.go b/pkg/client/drive_lister_test.go index 01157ce4e..b721df0f3 100644 --- a/pkg/client/drive_lister_test.go +++ b/pkg/client/drive_lister_test.go @@ -38,7 +38,7 @@ func TestGetDriveList(t *testing.T) { } objects := []runtime.Object{} - for i := 0; i < 2000; i++ { + for i := range 2000 { objects = append( objects, &types.Drive{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("drive-%v", i)}}, ) diff --git a/pkg/client/init.go b/pkg/client/init.go index 289d86720..19b610f00 100644 --- a/pkg/client/init.go +++ b/pkg/client/init.go @@ -121,7 +121,7 @@ func (c Client) Discovery() discovery.DiscoveryInterface { func NewClient(c *rest.Config) (*Client, error) { k8sClient, err := k8s.NewClient(c) if err != nil { - return nil, fmt.Errorf("unable to create kubernetes client; %v", err) + return nil, fmt.Errorf("unable to create kubernetes client; %w", err) } return newClient(k8sClient) } @@ -130,25 +130,25 @@ func NewClient(c *rest.Config) (*Client, error) { func newClient(k8sClient *k8s.Client) (*Client, error) { cs, err := clientset.NewForConfig(k8sClient.KubeConfig) if err != nil { - return nil, fmt.Errorf("unable to create new clientset interface; %v", err) + return nil, fmt.Errorf("unable to create new clientset interface; %w", err) } clientsetInterface := types.NewExtClientset(cs) restClient := clientsetInterface.DirectpvLatest().RESTClient() driveClient, err := latestDriveClientForConfig(k8sClient) if err != nil { - return nil, fmt.Errorf("unable to create new drive interface; %v", err) + return nil, fmt.Errorf("unable to create new drive interface; %w", err) } volumeClient, err := latestVolumeClientForConfig(k8sClient) if err != nil { - return nil, fmt.Errorf("unable to create new volume interface; %v", err) + return nil, fmt.Errorf("unable to create new volume interface; %w", err) } nodeClient, err := latestNodeClientForConfig(k8sClient) if err != nil { - return nil, fmt.Errorf("unable to create new node interface; %v", err) + return nil, fmt.Errorf("unable to create new node interface; %w", err) } initRequestClient, err := latestInitRequestClientForConfig(k8sClient) if err != nil { - return nil, fmt.Errorf("unable to create new initrequest interface; %v", err) + return nil, fmt.Errorf("unable to create new initrequest interface; %w", err) } return &Client{ ClientsetInterface: clientsetInterface, diff --git a/pkg/client/initrequest_lister.go b/pkg/client/initrequest_lister.go index 213529aa7..15c48574c 100644 --- a/pkg/client/initrequest_lister.go +++ b/pkg/client/initrequest_lister.go @@ -46,10 +46,10 @@ type InitRequestLister struct { } // NewInitRequestLister creates new volume lister. -func (client Client) NewInitRequestLister() *InitRequestLister { +func (c Client) NewInitRequestLister() *InitRequestLister { return &InitRequestLister{ maxObjects: k8s.MaxThreadCount, - initRequestClient: client.InitRequest(), + initRequestClient: c.InitRequest(), } } @@ -207,7 +207,7 @@ func (lister *InitRequestLister) Watch(ctx context.Context) (<-chan WatchEvent[* if err != nil { watchCh <- WatchEvent[*types.InitRequest]{ Type: result.Type, - Err: fmt.Errorf("unable to convert unstructured object %s; %v", unstructured.GetName(), err), + Err: fmt.Errorf("unable to convert unstructured object %s; %w", unstructured.GetName(), err), } continue } diff --git a/pkg/client/node_lister.go b/pkg/client/node_lister.go index 9ce5edac4..eee7d12c3 100644 --- a/pkg/client/node_lister.go +++ b/pkg/client/node_lister.go @@ -46,10 +46,10 @@ type NodeLister struct { } // NewNodeLister creates new volume lister. -func (client Client) NewNodeLister() *NodeLister { +func (c Client) NewNodeLister() *NodeLister { return &NodeLister{ maxObjects: k8s.MaxThreadCount, - nodeClient: client.Node(), + nodeClient: c.Node(), } } @@ -208,7 +208,7 @@ func (lister *NodeLister) Watch(ctx context.Context) (<-chan WatchEvent[*types.N if err != nil { watchCh <- WatchEvent[*types.Node]{ Type: result.Type, - Err: fmt.Errorf("unable to convert unstructured object %s; %v", unstructured.GetName(), err), + Err: fmt.Errorf("unable to convert unstructured object %s; %w", unstructured.GetName(), err), } continue } diff --git a/pkg/client/volume_lister.go b/pkg/client/volume_lister.go index cf9aadf94..5c5ea8b1c 100644 --- a/pkg/client/volume_lister.go +++ b/pkg/client/volume_lister.go @@ -49,10 +49,10 @@ type VolumeLister struct { } // NewVolumeLister creates new volume lister. -func (client Client) NewVolumeLister() *VolumeLister { +func (c Client) NewVolumeLister() *VolumeLister { return &VolumeLister{ maxObjects: k8s.MaxThreadCount, - volumeClient: client.Volume(), + volumeClient: c.Volume(), } } diff --git a/pkg/client/volume_lister_test.go b/pkg/client/volume_lister_test.go index c820bde22..eca1e281b 100644 --- a/pkg/client/volume_lister_test.go +++ b/pkg/client/volume_lister_test.go @@ -40,7 +40,7 @@ func TestGetVolumeList(t *testing.T) { } objects := []runtime.Object{} - for i := 0; i < 2000; i++ { + for i := range 2000 { objects = append( objects, &types.Volume{ObjectMeta: metav1.ObjectMeta{Name: fmt.Sprintf("volume-%v", i)}}, ) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index f15722fb6..c1fe5746b 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -18,6 +18,7 @@ package controller import ( "context" + "errors" "fmt" "sync" "time" @@ -90,7 +91,7 @@ func New(name string, handler EventHandler, workers int, resyncPeriod time.Durat ) informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { + AddFunc: func(obj any) { key, err := cache.MetaNamespaceKeyFunc(obj) if err != nil { klog.ErrorS(err, "unable to process an ADD event") @@ -98,7 +99,7 @@ func New(name string, handler EventHandler, workers int, resyncPeriod time.Durat queue.Add(Event{AddEvent, types.UID(key), obj.(runtime.Object)}) } }, - UpdateFunc: func(old, new interface{}) { + UpdateFunc: func(old, new any) { key, err := cache.MetaNamespaceKeyFunc(old) if err != nil { klog.ErrorS(err, "unable to process an UPDATE event") @@ -106,12 +107,20 @@ func New(name string, handler EventHandler, workers int, resyncPeriod time.Durat queue.Add(Event{UpdateEvent, types.UID(key), new.(runtime.Object)}) } }, - DeleteFunc: func(obj interface{}) { - key, err := cache.MetaNamespaceKeyFunc(obj) + DeleteFunc: func(obj any) { + // DeletionHandlingMetaNamespaceKeyFunc handles both raw objects and tombstones + key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) if err != nil { - klog.ErrorS(err, "unable to process a DELETE event") + klog.ErrorS(err, "unable to process an DELETE event") } else { - queue.Add(Event{DeleteEvent, types.UID(key), obj.(runtime.Object)}) + var finalObj runtime.Object + // If it's a tombstone, unwrap it so we have the object to get the Name from later + if tombstone, ok := obj.(cache.DeletedFinalStateUnknown); ok { + finalObj = tombstone.Obj.(runtime.Object) + } else { + finalObj = obj.(runtime.Object) + } + queue.Add(Event{DeleteEvent, types.UID(key), finalObj}) } }, }) @@ -134,12 +143,12 @@ func (c *Controller) Run(ctx context.Context) { go c.informer.Run(ctx.Done()) if !cache.WaitForCacheSync(ctx.Done(), c.HasSynced) { - utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync")) + utilruntime.HandleError(errors.New("timed out waiting for caches to sync")) return } klog.Infof("%s controller synced and ready", c.name) - for i := 0; i < c.workerThreads; i++ { + for range c.workerThreads { go wait.UntilWithContext(ctx, c.runWorker, time.Second) } @@ -201,12 +210,14 @@ func (c *Controller) processItem(ctx context.Context, event Event) error { // do not happen in parallel c.lock(event.Key) defer c.unlock(event.Key) - obj, exists, err := c.informer.GetIndexer().GetByKey(string(event.Key)) + obj, _, err := c.informer.GetIndexer().GetByKey(string(event.Key)) if err != nil { - return fmt.Errorf("error fetching object with key %s from store; %v", event.Key, err) + if event.Type != DeleteEvent { + return fmt.Errorf("unable to fetch object from store for key %s and event type %s; %w", event.Key, event.Type, err) + } } - if exists { - event.Object = obj.(runtime.Object) + if obj == nil { + obj = event.Object } - return c.handler.Handle(ctx, event.Type, event.Object) + return c.handler.Handle(ctx, event.Type, obj.(runtime.Object)) } diff --git a/pkg/controller/controller_test.go b/pkg/controller/controller_test.go index 934012f5c..519452559 100644 --- a/pkg/controller/controller_test.go +++ b/pkg/controller/controller_test.go @@ -56,6 +56,9 @@ func (handler *testEventHandler) ListerWatcher() cache.ListerWatcher { return client.VolumeClient().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if options.SendInitialEvents != nil && *options.SendInitialEvents { + return nil, errors.New("fake client does not support SendInitialEvents") + } options.LabelSelector = fmt.Sprintf("%s=%s", directpvtypes.NodeLabelKey, nodeID) return client.VolumeClient().Watch(context.TODO(), options) }, diff --git a/pkg/csi/controller/server_test.go b/pkg/csi/controller/server_test.go index b6c5c7bbf..c5e595e42 100644 --- a/pkg/csi/controller/server_test.go +++ b/pkg/csi/controller/server_test.go @@ -145,7 +145,7 @@ func TestCreateAndDeleteVolumeRPCs(t *testing.T) { if volumeID != volName { t.Errorf("[%s] Wrong volumeID found in the response. Expected: %v, Got: %v", volName, volName, volumeID) } - // Step 3: Check the the accessible topology in the response is matching with the request + // Step 3: Check the accessible topology in the response is matching with the request if !reflect.DeepEqual(vol.GetAccessibleTopology(), cvReq.GetAccessibilityRequirements().GetPreferred()) { t.Errorf("[%s] Accessible topology not matching with preferred topology in the request. Expected: %v, Got: %v", volName, cvReq.GetAccessibilityRequirements().GetPreferred(), vol.GetAccessibleTopology()) diff --git a/pkg/csi/node/publish_unpublish.go b/pkg/csi/node/publish_unpublish.go index df53655d7..045adb4de 100644 --- a/pkg/csi/node/publish_unpublish.go +++ b/pkg/csi/node/publish_unpublish.go @@ -148,7 +148,7 @@ func (server *Server) NodePublishVolume(ctx context.Context, req *csi.NodePublis func (server *Server) publishVolume(req *csi.NodePublishVolumeRequest, isSuspended bool) error { if err := server.mkdir(req.GetTargetPath()); err != nil && !errors.Is(err, os.ErrExist) { - return fmt.Errorf("unable to create target path; %v", err) + return fmt.Errorf("unable to create target path; %w", err) } mountInfo, err := server.getMounts() @@ -165,7 +165,7 @@ func (server *Server) publishVolume(req *csi.NodePublishVolumeRequest, isSuspend return nil } if err := server.bindMount(consts.TmpMountDir, req.GetTargetPath(), true); err != nil { - return fmt.Errorf("unable to bind mount target path %v to %v; %v", req.GetTargetPath(), consts.TmpMountDir, err) + return fmt.Errorf("unable to bind mount target path %v to %v; %w", req.GetTargetPath(), consts.TmpMountDir, err) } return nil } @@ -187,7 +187,7 @@ func (server *Server) publishVolume(req *csi.NodePublishVolumeRequest, isSuspend klog.V(5).InfoS("stagingTargetPath is already bind-mounted to targetPath", "stagingTargetPath", req.GetStagingTargetPath(), "targetPath", req.GetTargetPath()) } else { if err := server.bindMount(req.GetStagingTargetPath(), req.GetTargetPath(), req.GetReadonly()); err != nil { - return fmt.Errorf("unable to bind mount staging target path to target path; %v", err) + return fmt.Errorf("unable to bind mount staging target path to target path; %w", err) } } return nil diff --git a/pkg/csi/node/stage_unstage_test.go b/pkg/csi/node/stage_unstage_test.go index fb3cbbbb1..134af3d58 100644 --- a/pkg/csi/node/stage_unstage_test.go +++ b/pkg/csi/node/stage_unstage_test.go @@ -17,7 +17,7 @@ package node import ( - "fmt" + "errors" "path" "testing" @@ -80,7 +80,7 @@ func TestNodeStageVolume(t *testing.T) { } nodeServer.bindMount = func(source, _ string, _ bool) error { if testCase.mountInfo.FilterByMountSource(source).IsEmpty() { - return fmt.Errorf("source is not mounted") + return errors.New("source is not mounted") } return nil } diff --git a/pkg/device/probe.go b/pkg/device/probe.go index 349893e12..dbc225052 100644 --- a/pkg/device/probe.go +++ b/pkg/device/probe.go @@ -22,6 +22,7 @@ import ( "encoding/base64" "fmt" "sort" + "strconv" "strings" directpvtypes "github.com/minio/directpv/pkg/apis/directpv.min.io/types" @@ -60,15 +61,15 @@ func (d Device) ID(nodeID directpvtypes.NodeID) string { "node": string(nodeID), "name": d.Name, "majorminor": d.MajorMinor, - "size": fmt.Sprintf("%v", d.Size), - "hidden": fmt.Sprintf("%v", d.Hidden), - "removable": fmt.Sprintf("%v", d.Removable), - "readonly": fmt.Sprintf("%v", d.ReadOnly), - "partitioned": fmt.Sprintf("%v", d.Partitioned), + "size": strconv.FormatUint(d.Size, 10), + "hidden": strconv.FormatBool(d.Hidden), + "removable": strconv.FormatBool(d.Removable), + "readonly": strconv.FormatBool(d.ReadOnly), + "partitioned": strconv.FormatBool(d.Partitioned), "holders": strings.Join(d.Holders, ","), "mountpoints": strings.Join(d.MountPoints, ","), - "swapon": fmt.Sprintf("%v", d.SwapOn), - "cdrom": fmt.Sprintf("%v", d.CDROM), + "swapon": strconv.FormatBool(d.SwapOn), + "cdrom": strconv.FormatBool(d.CDROM), "dmname": d.DMName, "udevdata": strings.Join(toSlice(d.udevData, "="), ";"), } diff --git a/pkg/device/sync.go b/pkg/device/sync.go index e076767c3..cd4df2ec6 100644 --- a/pkg/device/sync.go +++ b/pkg/device/sync.go @@ -206,13 +206,13 @@ func updateDrive(ctx context.Context, driveName string, deviceMap map[string][]d check := func() error { switch { case mountEntry.FilesystemType != "xfs": - return fmt.Errorf("device filesystem is not XFS") + return errors.New("device filesystem is not XFS") case !mountEntry.MountOptions.Exist("prjquota"): - return fmt.Errorf("device mounted without 'prjquota' mount option") + return errors.New("device mounted without 'prjquota' mount option") case !mountEntry.MountOptions.Exist("noatime"): - return fmt.Errorf("device mounted without 'noatime' mount option") + return errors.New("device mounted without 'noatime' mount option") case !mountEntry.MountOptions.Exist("ro"): - return fmt.Errorf("device mounted in read-only mode") + return errors.New("device mounted in read-only mode") default: return nil } @@ -224,7 +224,7 @@ func updateDrive(ctx context.Context, driveName string, deviceMap map[string][]d } if len(mountPoints) != 0 { - klog.ErrorS(fmt.Errorf("device mounted outside of DirectPV"), "device", devices[0].Name, "mountPoints", mountPoints.ToSlice(), "drive", drive.GetDriveID(), drive.GetDriveName()) + klog.ErrorS(errors.New("device mounted outside of DirectPV"), "device", devices[0].Name, "mountPoints", mountPoints.ToSlice(), "drive", drive.GetDriveID(), drive.GetDriveName()) } updated = syncDrive(drive, devices[0]) diff --git a/pkg/device/sync_test.go b/pkg/device/sync_test.go index d2acb25ea..01607b583 100644 --- a/pkg/device/sync_test.go +++ b/pkg/device/sync_test.go @@ -23,21 +23,6 @@ import ( "github.com/minio/directpv/pkg/types" ) -func newDrive(name string, totalCapacity int64, make, volume string) *types.Drive { - drive := types.NewDrive( - directpvtypes.DriveID(name+"-id"), - types.DriveStatus{ - TotalCapacity: totalCapacity, - Make: make, - }, - directpvtypes.NodeID("nodeId"), - directpvtypes.DriveName(name), - directpvtypes.AccessTierDefault, - ) - drive.AddVolumeFinalizer(volume) - return drive -} - func newTestDevice(name string, totalCapacity int64, dmname string) device { return device{ TotalCapacity: totalCapacity, @@ -49,6 +34,21 @@ func newTestDevice(name string, totalCapacity int64, dmname string) device { } func TestSyncDrive(t *testing.T) { + newDrive := func(totalCapacity int64, make, volume string) *types.Drive { + drive := types.NewDrive( + directpvtypes.DriveID("sda-id"), + types.DriveStatus{ + TotalCapacity: totalCapacity, + Make: make, + }, + directpvtypes.NodeID("nodeId"), + directpvtypes.DriveName("sda"), + directpvtypes.AccessTierDefault, + ) + drive.AddVolumeFinalizer(volume) + return drive + } + testCases := []struct { drive *types.Drive device device @@ -58,7 +58,7 @@ func TestSyncDrive(t *testing.T) { expectedMake string }{ { - drive: newDrive("sda", 100, "dmname", "volume-1"), + drive: newDrive(100, "dmname", "volume-1"), device: newTestDevice("sda", 100, "dmname"), updated: false, expectedDriveName: "sda", @@ -66,7 +66,7 @@ func TestSyncDrive(t *testing.T) { expectedMake: "dmname", }, { - drive: newDrive("sda", 100, "dmname", "volume-1"), + drive: newDrive(100, "dmname", "volume-1"), device: newTestDevice("sda", 200, "dmname"), updated: true, expectedDriveName: "sda", @@ -74,7 +74,7 @@ func TestSyncDrive(t *testing.T) { expectedMake: "dmname", }, { - drive: newDrive("sda", 100, "dmname", "volume-1"), + drive: newDrive(100, "dmname", "volume-1"), device: newTestDevice("sda", 100, "dmname-new"), updated: true, expectedDriveName: "sda", @@ -82,7 +82,7 @@ func TestSyncDrive(t *testing.T) { expectedMake: "dmname-new", }, { - drive: newDrive("sda", 100, "dmname", "volume-1"), + drive: newDrive(100, "dmname", "volume-1"), device: newTestDevice("sdb", 100, "dmname"), updated: true, expectedDriveName: "sdb", @@ -90,7 +90,7 @@ func TestSyncDrive(t *testing.T) { expectedMake: "dmname", }, { - drive: newDrive("sda", 100, "dmname", "volume-1"), + drive: newDrive(100, "dmname", "volume-1"), device: newTestDevice("sda", 100, "dmname"), updated: false, expectedDriveName: "sda", diff --git a/pkg/drive/event.go b/pkg/drive/event.go index ff3c01e40..8648bbfee 100644 --- a/pkg/drive/event.go +++ b/pkg/drive/event.go @@ -114,7 +114,7 @@ func StageVolume( volumeDir := types.GetVolumeDir(volume.Status.FSUUID, volume.Name) if err := mkdir(volumeDir); err != nil && !errors.Is(err, os.ErrExist) { - if errors.Unwrap(err) == syscall.EIO { + if errors.Is(errors.Unwrap(err), syscall.EIO) { if err := SetIOError(ctx, volume.GetDriveID()); err != nil { return codes.Internal, fmt.Errorf("unable to set drive error; %w", err) } @@ -360,7 +360,7 @@ func (handler *driveEventHandler) checkDrive(ctx context.Context, drive *types.D switch drive.Status.Status { case directpvtypes.DriveStatusReady: if err := handler.exists(types.GetVolumeRootDir(drive.Status.FSUUID)); err != nil { - if errors.Unwrap(err) == syscall.EIO { + if errors.Is(errors.Unwrap(err), syscall.EIO) { if uerr := SetIOError(ctx, drive.GetDriveID()); uerr != nil { klog.ErrorS(uerr, "unable to set I/O error", "drive", drive.GetDriveID()) } diff --git a/pkg/drive/repair.go b/pkg/drive/repair.go index 65d90e8b2..2aa970c35 100644 --- a/pkg/drive/repair.go +++ b/pkg/drive/repair.go @@ -139,7 +139,7 @@ func repair(ctx context.Context, drive *types.Drive, force, disablePrefetch, dry merr := mount(device, target) if merr != nil { - klog.ErrorS(err, "unable to mount the drive", "Source", device, "Target", target) + klog.ErrorS(merr, "unable to mount the drive", "Source", device, "Target", target) } driveID := drive.GetDriveID() @@ -150,11 +150,11 @@ func repair(ctx context.Context, drive *types.Drive, force, disablePrefetch, dry } if merr != nil { - drive.SetMountErrorCondition(fmt.Sprintf("unable to mount; %v", err)) + drive.SetMountErrorCondition(fmt.Sprintf("unable to mount; %v", merr)) client.Eventf(drive, client.EventTypeWarning, client.EventReasonDriveMountError, - "unable to mount the drive; %v", err, + "unable to mount the drive; %v", merr, ) drive.Status.Status = directpvtypes.DriveStatusError } else { diff --git a/pkg/ellipsis/ellipsis.go b/pkg/ellipsis/ellipsis.go index 337cfda3d..7ea4525ed 100644 --- a/pkg/ellipsis/ellipsis.go +++ b/pkg/ellipsis/ellipsis.go @@ -75,7 +75,7 @@ func (e *ellipsis) get(prefix string) string { return "" } - value := fmt.Sprintf("%v", e.current) + value := strconv.FormatUint(e.current, 10) if e.isAlpha { value = int2alpha(e.current) } diff --git a/pkg/initrequest/event.go b/pkg/initrequest/event.go index 51f48a4ca..56933fbf6 100644 --- a/pkg/initrequest/event.go +++ b/pkg/initrequest/event.go @@ -18,6 +18,7 @@ package initrequest import ( "context" + "errors" "fmt" "os" "strings" @@ -259,7 +260,7 @@ func (handler *initRequestEventHandler) initDevice(device pkgdevice.Device, forc return } if uerr := handler.unmount(fsuuid); uerr != nil { - err = fmt.Errorf("%w; %v", err, uerr) + err = errors.Join(err, uerr) } }() diff --git a/pkg/initrequest/reflink_linux.go b/pkg/initrequest/reflink_linux.go index 2fa6358e9..394bcc0ae 100644 --- a/pkg/initrequest/reflink_linux.go +++ b/pkg/initrequest/reflink_linux.go @@ -21,7 +21,6 @@ package initrequest import ( "context" "errors" - "fmt" "os" losetup "github.com/freddierice/go-losetup/v2" @@ -68,7 +67,7 @@ func reflinkSupported(ctx context.Context) (bool, error) { }() if err = xfs.Mount(loopDevice.Path(), mountPoint); err != nil { - return fmt.Errorf("%w; %v", errMountFailed, err) + return errors.Join(errMountFailed, err) } return sys.Unmount(mountPoint, true, true, false) diff --git a/pkg/k8s/client.go b/pkg/k8s/client.go index b0e87db16..4fa08a71b 100644 --- a/pkg/k8s/client.go +++ b/pkg/k8s/client.go @@ -18,6 +18,7 @@ package k8s import ( "context" + "errors" "fmt" "strconv" "strings" @@ -50,16 +51,16 @@ type Client struct { func NewClient(kubeConfig *rest.Config) (*Client, error) { kubeClient, err := kubernetes.NewForConfig(kubeConfig) if err != nil { - return nil, fmt.Errorf("unable to create new kubernetes client interface; %v", err) + return nil, fmt.Errorf("unable to create new kubernetes client interface; %w", err) } apiextensionsClient, err := apiextensions.NewForConfig(kubeConfig) if err != nil { - return nil, fmt.Errorf("unable to create new API extensions client interface; %v", err) + return nil, fmt.Errorf("unable to create new API extensions client interface; %w", err) } crdClient := apiextensionsClient.CustomResourceDefinitions() discoveryClient, err := discovery.NewDiscoveryClientForConfig(kubeConfig) if err != nil { - return nil, fmt.Errorf("unable to create new discovery client interface; %v", err) + return nil, fmt.Errorf("unable to create new discovery client interface; %w", err) } return &Client{ KubeConfig: kubeConfig, @@ -79,7 +80,7 @@ func (client *Client) GetKubeVersion() (major, minor uint, err error) { var u64 uint64 if u64, err = strconv.ParseUint(versionInfo.Major, 10, 64); err != nil { - return 0, 0, fmt.Errorf("unable to parse major version %v; %v", versionInfo.Major, err) + return 0, 0, fmt.Errorf("unable to parse major version %v; %w", versionInfo.Major, err) } major = uint(u64) @@ -93,7 +94,7 @@ func (client *Client) GetKubeVersion() (major, minor uint, err error) { } } if u64, err = strconv.ParseUint(minorString, 10, 64); err != nil { - return 0, 0, fmt.Errorf("unable to parse minor version %v; %v", minor, err) + return 0, 0, fmt.Errorf("unable to parse minor version %v; %w", minor, err) } minor = uint(u64) return major, minor, nil @@ -160,7 +161,7 @@ func (client *Client) GetCSINodes(ctx context.Context) (nodes []string, err erro switch gvk.Version { case "v1apha1": - err = fmt.Errorf("unsupported CSINode storage.k8s.io/v1alpha1") + err = errors.New("unsupported CSINode storage.k8s.io/v1alpha1") case "v1": result := &storagev1.CSINodeList{} if err = storageClient.Get(). diff --git a/pkg/legacy/client/init.go b/pkg/legacy/client/init.go index 3140b421c..e983eacdb 100644 --- a/pkg/legacy/client/init.go +++ b/pkg/legacy/client/init.go @@ -43,11 +43,11 @@ func Init() { func NewClient(k8sClient *k8s.Client) (*Client, error) { driveClient, err := DirectCSIDriveInterfaceForConfig(k8sClient) if err != nil { - return nil, fmt.Errorf("unable to create new DirectCSI drive interface; %v", err) + return nil, fmt.Errorf("unable to create new DirectCSI drive interface; %w", err) } volumeClient, err := DirectCSIVolumeInterfaceForConfig(k8sClient) if err != nil { - return nil, fmt.Errorf("unable to create new DirectCSI volume interface; %v", err) + return nil, fmt.Errorf("unable to create new DirectCSI volume interface; %w", err) } return &Client{ DriveClient: driveClient, diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 6d46544f7..61edd287b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -82,7 +82,7 @@ func NewSafeFile(filename string) (*SafeFile, error) { }, nil } -// Writes writes to the file +// Write writes to the file func (safeFile *SafeFile) Write(p []byte) (int, error) { return safeFile.tempFile.Write(p) } diff --git a/pkg/volume/event.go b/pkg/volume/event.go index 7881d7490..4f9122f4d 100644 --- a/pkg/volume/event.go +++ b/pkg/volume/event.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "io/fs" "os" "time" @@ -116,7 +117,8 @@ func (handler *volumeEventHandler) delete(ctx context.Context, volume *types.Vol if volume.Status.TargetPath != "" { if err := handler.unmount(volume.Status.TargetPath); err != nil { - if _, ok := err.(*os.PathError); !ok { + var perr *fs.PathError + if !errors.As(err, &perr) { klog.ErrorS(err, "unable to unmount container path", "volume", volume.Name, "containerPath", volume.Status.TargetPath, @@ -127,7 +129,8 @@ func (handler *volumeEventHandler) delete(ctx context.Context, volume *types.Vol } if volume.Status.StagingTargetPath != "" { if err := handler.unmount(volume.Status.StagingTargetPath); err != nil { - if _, ok := err.(*os.PathError); !ok { + var perr *fs.PathError + if !errors.As(err, &perr) { klog.ErrorS(err, "unable to unmount staging path", "volume", volume.Name, "StagingTargetPath", volume.Status.StagingTargetPath, diff --git a/pkg/xfs/probe_linux.go b/pkg/xfs/probe_linux.go index 7690468a4..d4f3b82a0 100644 --- a/pkg/xfs/probe_linux.go +++ b/pkg/xfs/probe_linux.go @@ -22,6 +22,7 @@ import ( "bytes" "context" "encoding/binary" + "errors" "fmt" "io" "os" @@ -121,7 +122,7 @@ func probe(path string) (fsuuid, label string, totalCapacity, freeCapacity uint6 case <-ticker.C: klog.InfoS("XFS probe is taking too long; still waiting", "device", path) case <-ctx.Done(): - err = fmt.Errorf("%w; %v", ErrCanceled, ctx.Err()) + err = errors.Join(ErrCanceled, ctx.Err()) return case <-doneCh: return fsuuid, label, totalCapacity, freeCapacity, err diff --git a/pkg/xfs/quota.go b/pkg/xfs/quota.go index 15d8e546a..d00a92a5c 100644 --- a/pkg/xfs/quota.go +++ b/pkg/xfs/quota.go @@ -19,7 +19,6 @@ package xfs import ( "context" "errors" - "fmt" ) // ErrCanceled denotes canceled by context error. @@ -42,7 +41,7 @@ func GetQuota(ctx context.Context, device, volumeID string) (quota *Quota, err e select { case <-ctx.Done(): - return nil, fmt.Errorf("%w; %v", ErrCanceled, ctx.Err()) + return nil, errors.Join(ErrCanceled, ctx.Err()) case <-doneCh: } @@ -59,7 +58,7 @@ func SetQuota(ctx context.Context, device, path, volumeID string, quota Quota, u select { case <-ctx.Done(): - return fmt.Errorf("%w; %v", ErrCanceled, ctx.Err()) + return errors.Join(ErrCanceled, ctx.Err()) case <-doneCh: }