Skip to content

Commit 2878873

Browse files
committed
upgrade dependencies, linters and controller
Signed-off-by: Bala.FA <bala@minio.io>
1 parent e08d227 commit 2878873

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+472
-391
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
build:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4
21-
- uses: actions/setup-go@v5
20+
- uses: actions/checkout@v6
21+
- uses: actions/setup-go@v6
2222
with:
23-
go-version: 1.24.x
23+
go-version: 1.26.x
2424
check-latest: true
2525
- name: Set environment
2626
run: |
@@ -33,8 +33,8 @@ jobs:
3333
run: |
3434
./build.sh
3535
go test -v ./...
36-
- uses: docker/setup-qemu-action@v3
36+
- uses: docker/setup-qemu-action@v4
3737
- name: Check Goreleaser
38-
uses: goreleaser/goreleaser-action@v6
38+
uses: goreleaser/goreleaser-action@v7
3939
with:
4040
args: release --skip=publish,sign --clean --snapshot

.github/workflows/functests.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
timeout-minutes: 60
2121
strategy:
2222
matrix:
23-
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']
23+
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']
2424
os: [ubuntu-22.04, ubuntu-24.04]
2525

2626
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-go@v5
27+
- uses: actions/checkout@v6
28+
- uses: actions/setup-go@v6
2929
with:
30-
go-version: 1.24.x
30+
go-version: 1.26.x
3131
check-latest: true
3232

3333
- name: Install dependencies
@@ -51,16 +51,12 @@ jobs:
5151
go build -tags "osusergo netgo static_build" -ldflags="-X main.Version=${VERSION} -extldflags=-static" github.com/minio/directpv/cmd/directpv
5252
go build -tags "osusergo netgo static_build" -ldflags="-X main.Version=${VERSION} -extldflags=-static" github.com/minio/directpv/cmd/kubectl-directpv
5353
54-
- name: Build docker image
55-
run: |
56-
docker build --quiet -t quay.io/minio/directpv:${VERSION} .
57-
docker build --quiet -t example.org/test/sleep:v0.0.1 -f functests/Dockerfile.sleep functests
58-
5954
- name: Setup Minikube
6055
uses: medyagh/setup-minikube@latest
6156
with:
6257
driver: none
6358
kubernetes-version: ${{ matrix.kube-version }}
59+
start-args: '--force'
6460

6561
- name: Check Minikube
6662
run: |
@@ -69,6 +65,11 @@ jobs:
6965
while kubectl get pods -n kube-system --no-headers | grep -vqw Running; do echo "Waiting for Minikube pods to be ready"; sleep 3; done
7066
while kubectl get nodes --no-headers | grep -vqw Ready; do echo "Waiting for Minikube node to be ready"; sleep 3; done
7167
68+
- name: Build docker image
69+
run: |
70+
docker build --quiet -t quay.io/minio/directpv:${VERSION} .
71+
docker build --quiet -t example.org/test/sleep:v0.0.1 -f functests/Dockerfile.sleep functests
72+
7273
- name: Run tests
7374
run: |
7475
functests/run-tests.sh
@@ -79,7 +80,7 @@ jobs:
7980
functests/run-migration-tests.sh "v3.2.2"
8081
8182
- name: Run migration tests with DirectCSI v2.0.9
82-
if: contains(fromJson('["v1.20.15", "v1.21.14", "v1.22.17"]'), matrix.kube-version)
83+
if: contains(fromJson('["v1.19.16", "v1.20.15", "v1.21.14", "v1.22.17"]'), matrix.kube-version)
8384
run: |
8485
sudo rm -fr /var/lib/directpv /var/lib/direct-csi
8586
functests/run-migration-tests.sh "v2.0.9"

.github/workflows/linters.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
linters:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4
21-
- uses: actions/setup-go@v5
20+
- uses: actions/checkout@v6
21+
- uses: actions/setup-go@v6
2222
with:
23-
go-version: 1.24.x
23+
go-version: 1.26.x
2424
check-latest: true
2525
- uses: ludeeus/action-shellcheck@master
26-
- uses: golangci/golangci-lint-action@v8
26+
- uses: golangci/golangci-lint-action@v9
2727
with:
28-
version: v2.2.1
28+
version: v2.11.3
2929
args: --config ./.golangci.yml --timeout=60m

.github/workflows/vulncheck.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Check out code
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323
- name: Set up Go
24-
uses: actions/setup-go@v5
24+
uses: actions/setup-go@v6
2525
with:
26-
go-version: 1.24.x
26+
go-version: 1.26.x
2727
check-latest: true
2828
- name: Install govulncheck
2929
run: go install golang.org/x/vuln/cmd/govulncheck@latest

.golangci.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: "2"
22
run:
3-
go: "1.24"
3+
go: "1.26"
44
linters:
55
default: none
66
enable:
@@ -15,24 +15,27 @@ linters:
1515
- unconvert
1616
- unused
1717
- usetesting
18+
- dupword
19+
- errorlint
20+
- intrange
21+
- nilnesserr
22+
- perfsprint
23+
- unparam
1824
settings:
1925
misspell:
2026
locale: US
21-
exclusions:
22-
generated: lax
23-
rules:
24-
- path: (.+)\.go$
25-
text: should have a package comment
26-
- path: (.+)\.go$
27-
text: exitAfterDefer
28-
- path: (.+)\.go$
29-
text: redefines-builtin-id
30-
- path: (.+)\.go$
31-
text: avoid meaningless package names
32-
paths:
33-
- third_party$
34-
- builtin$
35-
- examples$
27+
staticcheck:
28+
checks:
29+
- all
30+
- -ST1000
31+
- -SA1019
32+
revive:
33+
rules:
34+
- name: var-naming
35+
disabled: true
36+
gocritic:
37+
disabled-checks:
38+
- exitAfterDefer
3639
formatters:
3740
enable:
3841
- gofmt

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ release:
1717

1818
before:
1919
hooks:
20-
- go mod tidy -compat=1.24
20+
- go mod tidy -compat=1.26
2121
- go mod download
2222

2323
builds:

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ COPY LICENSE /licenses/LICENSE
88

99
RUN microdnf update --nodocs
1010

11-
COPY AlmaLinux.repo /etc/yum.repos.d/AlmaLinux.repo
11+
COPY AlmaLinux.repo /AlmaLinux.repo
1212

1313
RUN \
1414
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 && \
15-
microdnf install xfsprogs --nodocs && \
15+
microdnf install dnf --nodocs && \
16+
mv /AlmaLinux.repo /etc/yum.repos.d/AlmaLinux.repo && \
17+
dnf --quiet --assumeyes --nodocs install xfsprogs && \
18+
dnf --quiet --assumeyes clean all && \
19+
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 && \
1620
microdnf clean all && \
1721
rm -f /etc/yum.repos.d/AlmaLinux.repo
1822

cmd/directpv/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ package main
1818

1919
import (
2020
"context"
21+
"errors"
2122
"flag"
22-
"fmt"
2323
"os"
2424
"os/signal"
2525
"syscall"
@@ -67,7 +67,7 @@ var mainCmd = &cobra.Command{
6767
},
6868
PersistentPreRunE: func(_ *cobra.Command, _ []string) error {
6969
if kubeNodeName == "" {
70-
return fmt.Errorf("value to --kube-node-name must be provided")
70+
return errors.New("value to --kube-node-name must be provided")
7171
}
7272

7373
nodeID = directpvtypes.NodeID(kubeNodeName)

cmd/kubectl-directpv/discover.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func discoverDevices(ctx context.Context, nodes, drives []string, teaProgram *te
296296
default:
297297
}
298298
case <-ctx.Done():
299-
err = fmt.Errorf("unable to complete the discovery; %v", ctx.Err())
299+
err = fmt.Errorf("unable to complete the discovery; %w", ctx.Err())
300300
return
301301
}
302302
}

cmd/kubectl-directpv/flags.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func validateNodeArgs() error {
145145
for i := range nodesArgs {
146146
nodesArgs[i] = strings.TrimSpace(nodesArgs[i])
147147
if nodesArgs[i] == "" {
148-
return fmt.Errorf("empty node name")
148+
return errors.New("empty node name")
149149
}
150150
result, err := ellipsis.Expand(nodesArgs[i])
151151
if err != nil {
@@ -164,7 +164,7 @@ func validateDriveNameArgs() error {
164164
for i := range drivesArgs {
165165
drivesArgs[i] = strings.TrimSpace(utils.TrimDevPrefix(drivesArgs[i]))
166166
if drivesArgs[i] == "" {
167-
return fmt.Errorf("empty drive name")
167+
return errors.New("empty drive name")
168168
}
169169
result, err := ellipsis.Expand(drivesArgs[i])
170170
if err != nil {
@@ -193,7 +193,7 @@ func validateDriveIDArgs() error {
193193
for i := range driveIDArgs {
194194
driveIDArgs[i] = strings.TrimSpace(driveIDArgs[i])
195195
if driveIDArgs[i] == "" {
196-
return fmt.Errorf("empty drive ID")
196+
return errors.New("empty drive ID")
197197
}
198198
if !utils.IsUUID(driveIDArgs[i]) {
199199
return fmt.Errorf("invalid drive ID %v", driveIDArgs[i])
@@ -209,7 +209,7 @@ func validatePodNameArgs() error {
209209
for i := range podNameArgs {
210210
podNameArgs[i] = strings.TrimSpace(podNameArgs[i])
211211
if podNameArgs[i] == "" {
212-
return fmt.Errorf("empty pod name")
212+
return errors.New("empty pod name")
213213
}
214214
result, err := ellipsis.Expand(podNameArgs[i])
215215
if err != nil {
@@ -228,7 +228,7 @@ func validatePodNSArgs() error {
228228
for i := range podNSArgs {
229229
podNSArgs[i] = strings.TrimSpace(podNSArgs[i])
230230
if podNSArgs[i] == "" {
231-
return fmt.Errorf("empty pod namespace")
231+
return errors.New("empty pod namespace")
232232
}
233233
result, err := ellipsis.Expand(podNSArgs[i])
234234
if err != nil {
@@ -245,7 +245,7 @@ func validateVolumeNameArgs() error {
245245
for i := range volumeNameArgs {
246246
volumeNameArgs[i] = strings.TrimSpace(volumeNameArgs[i])
247247
if volumeNameArgs[i] == "" {
248-
return fmt.Errorf("empty volume name")
248+
return errors.New("empty volume name")
249249
}
250250
}
251251
return nil

0 commit comments

Comments
 (0)