Skip to content

Commit 4c0af36

Browse files
authored
chore: update go dependencies and docs (#35)
* chore: don't cache apk packages * chore: bump go dependencies * chore: bump app version to 2.6.1 and chart to 1.5.1 * fix: remove runAsNonRoot config default which doesn't belong * fox: update test and chart changelog
1 parent 4c88a15 commit 4c0af36

11 files changed

Lines changed: 212 additions & 201 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.6.1] - 2026-06-21
6+
7+
### Changed
8+
- build: optimize Containerfile — `--no-cache` on apk, remove redundant packages, Go 1.26 dependency consistency
9+
- docs: update README
10+
511
## [2.6.0] - 2026-06-20
612

713
### Added

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Full-featured Helm chart, published as an OCI artifact to `ghcr.io/upcloud-tools
2121
- Node DaemonSet with node-driver-registrar
2222
- Snapshot controller (2 replicas, leader election) and optional validation webhook
2323
- StorageClasses for all three UpCloud tiers: `maxiops`, `standard`, `hdd`
24+
- `securityContext` and `podSecurityContext` per component with secure defaults
25+
- `metrics` block — ClusterIP metrics Service, optional ServiceMonitor and PrometheusRule for prometheus-operator
26+
- `extraObjects` — deploy arbitrary Kubernetes resources with Go template support
27+
- Configurable pod spec fields
2428
- PodDisruptionBudget support for controller and snapshot-controller
2529
- Credential checksum annotation for automatic pod rollout on secret changes
2630

@@ -54,7 +58,6 @@ This repository uses the following security and supply-chain measures:
5458
- **Branch protection**`main` requires passing status checks (`golangci-lint`, `helm-lint`, `test`, CodeQL) and pull request review before merge.
5559
- **Action pinning** — All GitHub Actions pinned by commit SHA with a human-readable version comment; enforced globally.
5660
- **Static analysis**`golangci-lint` with 50+ linters (`gosec`, `staticcheck`, `errcheck`, etc.) runs on every PR.
57-
- **Container image** — Distroless-inspired Alpine runtime, multistage build, pinned base image versions.
5861
- **Container scanning (Trivy)**`aquasecurity/trivy-action` scans the built image for OS and application CVEs before push to GHCR; scheduled weekly rescan catches newly discovered vulnerabilities. Go module dependencies also scanned on every push/PR.
5962
- **Release integrity** — Helm chart validates that `appVersion` matches the git tag and that the container image exists before publishing.
6063
- **Artifact Hub** — Helm chart metadata published to Artifact Hub for discoverability.
@@ -85,36 +88,27 @@ kubectl delete crd volumesnapshotclasses.snapshot.storage.k8s.io \
8588
volumesnapshots.snapshot.storage.k8s.io
8689
```
8790

88-
Or keep the existing CRDs and install with `--skip-crds`:
91+
Or keep the existing CRDs and install with `--skip-crds` (not recommended).
8992

9093
### Helm chart (install/upgrade)
9194

92-
If the `upcloud` secret already exists in the namespace, omit the credentials (default behavior):
95+
UpCloud Kubernetes clusters ship with an `upcloud` secret in `kube-system` by default. If the secret exists, just install:
9396

9497
```shell
9598
helm upgrade --install upcloud-csi oci://ghcr.io/upcloud-tools/charts/upcloud-csi \
96-
--namespace kube-system --version 1.2.0
99+
--namespace kube-system --version 1.5.1
97100
```
98101

99-
Or specify credentials to create the secret (prepend with a space to avoid saving to shell history):
100-
101-
```shell
102-
helm upgrade --install upcloud-csi oci://ghcr.io/upcloud-tools/charts/upcloud-csi \
103-
--namespace kube-system --version 1.2.0 \
104-
--set credentials.createSecret=true \
105-
--set credentials.username=YOUR_USERNAME \
106-
--set credentials.password=YOUR_PASSWORD
107-
```
108-
109-
By default, StorageClasses are **disabled**. Enable them with `--set storageClasses.enabled=true` if you want the chart to manage them.
102+
To have the chart create the secret instead, set `credentials.createSecret=true` and provide the credentials.
103+
By default, StorageClasses are **disabled**. Enable them with `--set storageClasses.enabled=true`.
110104

111105
All values have sensible defaults. See [values.yaml](deploy/helm/values.yaml) for the full reference.
112106

113107
To customize, create a values file and pass it with `--values`:
114108

115109
```shell
116110
helm upgrade --install upcloud-csi oci://ghcr.io/upcloud-tools/charts/upcloud-csi \
117-
--namespace kube-system --version 1.2.0 --values values.yaml
111+
--namespace kube-system --version 1.5.1 --values values.yaml
118112
```
119113

120114
## Credits

cmd/upcloud-csi-plugin/Containerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@ FROM alpine:3.23
1919
LABEL org.opencontainers.image.source=https://github.com/upcloud-tools/upcloud-csi \
2020
org.opencontainers.image.description="UpCloud CSI Driver"
2121

22-
RUN apk add ca-certificates \
22+
RUN apk add --no-cache \
23+
ca-certificates \
2324
cloud-utils-growpart \
2425
e2fsprogs \
25-
eudev \
26-
findmnt \
27-
xfsprogs \
28-
xfsprogs-extra \
29-
blkid \
3026
e2fsprogs-extra \
27+
eudev \
28+
parted \
3129
util-linux \
32-
parted
30+
xfsprogs \
31+
xfsprogs-extra
3332

3433
COPY --from=build /workspace/upcloud-csi-plugin /bin/
3534

deploy/helm/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Helm chart changelog
22

3+
## [1.5.1] - 2026-06-20
4+
5+
### Changed
6+
- App version bumped to `v2.6.1`
7+
- Containerfile optimized — smaller runtime image
8+
9+
### Fixed
10+
- Remove `runAsNonRoot` from controller, snapshot-controller, and webhook `podSecurityContext` defaults — CSI sidecar images run as root and cannot be launched with this constraint
11+
312
## [1.5.0] - 2026-06-20
413

514
### Changed

deploy/helm/Chart.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: upcloud-csi
33
description: CSI driver for UpCloud block storage
44
type: application
5-
version: "1.5.0"
6-
appVersion: "v2.6.0"
5+
version: "1.5.1"
6+
appVersion: "v2.6.1"
77
kubeVersion: ">=1.21.0"
88
keywords:
99
- csi
@@ -25,6 +25,5 @@ annotations:
2525
- name: Support
2626
url: https://github.com/upcloud-tools/upcloud-csi/issues
2727
artifacthub.io/changes: |
28-
- "Add metrics Service, ServiceMonitor, and PrometheusRule support"
29-
- "Driver plugin exposes Prometheus metrics via --metrics-address flag"
30-
- "Driver metrics port on controller and node, wired into Service and ServiceMonitor"
28+
- "App version bumped to v2.6.1"
29+
- "Containerfile optimized — smaller runtime image"

deploy/helm/tests/security-context_test.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ tests:
33
- it: should render default podSecurityContext on controller
44
template: controller-statefulset.yaml
55
asserts:
6-
- equal:
7-
path: spec.template.spec.securityContext.runAsNonRoot
8-
value: true
96
- equal:
107
path: spec.template.spec.securityContext.seccompProfile.type
118
value: RuntimeDefault
9+
- notExists:
10+
path: spec.template.spec.securityContext.runAsNonRoot
1211

1312
- it: should render default container securityContext on all controller containers
1413
template: controller-statefulset.yaml
@@ -66,12 +65,11 @@ tests:
6665
- it: should render default podSecurityContext on snapshot controller
6766
template: snapshot-controller-deployment.yaml
6867
asserts:
69-
- equal:
70-
path: spec.template.spec.securityContext.runAsNonRoot
71-
value: true
7268
- equal:
7369
path: spec.template.spec.securityContext.seccompProfile.type
7470
value: RuntimeDefault
71+
- notExists:
72+
path: spec.template.spec.securityContext.runAsNonRoot
7573

7674
- it: should render default container securityContext on snapshot controller
7775
template: snapshot-controller-deployment.yaml
@@ -93,12 +91,11 @@ tests:
9391
template: snapshot-webhook.yaml
9492
documentIndex: 2
9593
asserts:
96-
- equal:
97-
path: spec.template.spec.securityContext.runAsNonRoot
98-
value: true
9994
- equal:
10095
path: spec.template.spec.securityContext.seccompProfile.type
10196
value: RuntimeDefault
97+
- notExists:
98+
path: spec.template.spec.securityContext.runAsNonRoot
10299

103100
- it: should render default container securityContext on webhook
104101
set:

deploy/helm/values.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ controller: # @schema additionalProperties: false
118118
readOnlyRootFilesystem: true
119119
# -- Pod-level security context for controller pods.
120120
podSecurityContext: # @schema additionalProperties: false
121-
runAsNonRoot: true
122121
seccompProfile:
123122
type: RuntimeDefault
124123

@@ -237,7 +236,6 @@ snapshotController: # @schema additionalProperties: false
237236
readOnlyRootFilesystem: true
238237
# -- Pod-level security context for snapshot controller pods.
239238
podSecurityContext: # @schema additionalProperties: false
240-
runAsNonRoot: true
241239
seccompProfile:
242240
type: RuntimeDefault
243241
# -- Extra labels for the snapshot controller pod template.
@@ -306,7 +304,6 @@ snapshotValidationWebhook: # @schema additionalProperties: false
306304
readOnlyRootFilesystem: true
307305
# -- Pod-level security context for webhook pods.
308306
podSecurityContext: # @schema additionalProperties: false
309-
runAsNonRoot: true
310307
seccompProfile:
311308
type: RuntimeDefault
312309
# -- Extra labels for the snapshot validation webhook pod template.

go.mod

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,80 @@
11
module github.com/upcloud-tools/upcloud-csi
22

3-
go 1.24.13
3+
go 1.26
44

55
require (
66
github.com/container-storage-interface/spec v1.6.0
77
github.com/golang/protobuf v1.5.4
88
github.com/google/uuid v1.6.0
9-
github.com/onsi/ginkgo/v2 v2.9.2
10-
github.com/onsi/gomega v1.27.5
11-
github.com/sirupsen/logrus v1.8.3
12-
github.com/spf13/pflag v1.0.5
9+
github.com/onsi/ginkgo/v2 v2.27.2
10+
github.com/onsi/gomega v1.38.2
11+
github.com/sirupsen/logrus v1.9.4
12+
github.com/spf13/pflag v1.0.9
1313
github.com/stretchr/testify v1.11.1
14-
golang.org/x/sync v0.19.0
15-
golang.org/x/sys v0.39.0
16-
google.golang.org/grpc v1.79.3
17-
google.golang.org/protobuf v1.36.10
18-
k8s.io/api v0.26.1
19-
k8s.io/apimachinery v0.26.1
20-
k8s.io/client-go v0.26.1
14+
golang.org/x/sync v0.21.0
15+
golang.org/x/sys v0.46.0
16+
google.golang.org/grpc v1.81.1
17+
google.golang.org/protobuf v1.36.11
18+
k8s.io/api v0.35.6
19+
k8s.io/apimachinery v0.35.6
20+
k8s.io/client-go v0.35.6
2121
)
2222

2323
require github.com/kubernetes-csi/csi-test/v5 v5.0.0
2424

2525
require (
26-
github.com/UpCloudLtd/upcloud-go-api/v8 v8.36.1
26+
github.com/UpCloudLtd/upcloud-go-api/v8 v8.38.0
2727
github.com/prometheus/client_golang v1.23.2
2828
)
2929

3030
require (
31-
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
32-
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
33-
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
34-
golang.org/x/tools v0.39.0 // indirect
31+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
32+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
33+
golang.org/x/tools v0.41.0 // indirect
3534
)
3635

3736
require (
37+
github.com/Masterminds/semver/v3 v3.4.0 // indirect
3838
github.com/beorn7/perks v1.0.1 // indirect
3939
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4040
github.com/davecgh/go-spew v1.1.1 // indirect
41+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
4142
github.com/go-logr/logr v1.4.3 // indirect
42-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
43-
github.com/go-openapi/jsonreference v0.20.0 // indirect
44-
github.com/go-openapi/swag v0.22.3 // indirect
45-
github.com/gogo/protobuf v1.3.2 // indirect
46-
github.com/google/gnostic v0.6.9 // indirect
43+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
44+
github.com/go-openapi/jsonreference v0.20.2 // indirect
45+
github.com/go-openapi/swag v0.23.0 // indirect
46+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
47+
github.com/google/gnostic-models v0.7.0 // indirect
4748
github.com/google/go-cmp v0.7.0 // indirect
48-
github.com/google/gofuzz v1.2.0 // indirect
49-
github.com/imdario/mergo v0.3.13 // indirect
5049
github.com/josharian/intern v1.0.0 // indirect
5150
github.com/json-iterator/go v1.1.12 // indirect
5251
github.com/mailru/easyjson v0.7.7 // indirect
5352
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
54-
github.com/modern-go/reflect2 v1.0.2 // indirect
53+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
5554
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5655
github.com/pmezard/go-difflib v1.0.0 // indirect
5756
github.com/prometheus/client_model v0.6.2 // indirect
5857
github.com/prometheus/common v0.66.1 // indirect
5958
github.com/prometheus/procfs v0.16.1 // indirect
60-
go.yaml.in/yaml/v2 v2.4.2 // indirect
61-
golang.org/x/net v0.48.0 // indirect
62-
golang.org/x/oauth2 v0.34.0 // indirect
63-
golang.org/x/term v0.38.0 // indirect
64-
golang.org/x/text v0.32.0 // indirect
65-
golang.org/x/time v0.3.0 // indirect
59+
github.com/x448/float16 v0.8.4 // indirect
60+
go.yaml.in/yaml/v2 v2.4.3 // indirect
61+
go.yaml.in/yaml/v3 v3.0.4 // indirect
62+
golang.org/x/mod v0.32.0 // indirect
63+
golang.org/x/net v0.51.0 // indirect
64+
golang.org/x/oauth2 v0.36.0 // indirect
65+
golang.org/x/term v0.40.0 // indirect
66+
golang.org/x/text v0.34.0 // indirect
67+
golang.org/x/time v0.9.0 // indirect
6668
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
69+
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
6770
gopkg.in/inf.v0 v0.9.1 // indirect
6871
gopkg.in/yaml.v2 v2.4.0 // indirect
6972
gopkg.in/yaml.v3 v3.0.1 // indirect
70-
k8s.io/klog/v2 v2.80.1 // indirect
71-
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
72-
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
73-
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
74-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
75-
sigs.k8s.io/yaml v1.3.0 // indirect
73+
k8s.io/klog/v2 v2.130.1 // indirect
74+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
75+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
76+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
77+
sigs.k8s.io/randfill v1.0.0 // indirect
78+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
79+
sigs.k8s.io/yaml v1.6.0 // indirect
7680
)

0 commit comments

Comments
 (0)