Skip to content

Commit 70ec972

Browse files
authored
Merge pull request #97 from cloudscale-ch/release/3.5.7-prerelease
fix race conditions on stage/unstage volume
2 parents 66e0b86 + 904c815 commit 70ec972

File tree

24 files changed

+2890
-135
lines changed

24 files changed

+2890
-135
lines changed

.github/workflows/release-chart.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- 'release/[0-9]+.[0-9]+.*'
78

89
jobs:
910
release:

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## unreleased
2-
* Minimum supported Kubernetes version is now 1.28.
2+
* The minimum supported Kubernetes version is now 1.28.
3+
* Upgrade all sidecars to latest version
4+
* Please note the RBAC changes as a result of this upgrade
5+
* Fix race conditions on stage/unstage/publish/unpublish volume
6+
* Add volume locks to avoid concurrent operations on the same volume
7+
* Add detection if symlinks don't add up to the right volume
8+
* Adjust udevadm calls & reorder them and put them behind a mutex to avoid a potential race condition
9+
* Add `--log-level=(trace|debug|info|warn|error)` flag to customize log level
310

411
## v3.5.6 - 2024.04.18
512
* ~~Add support for Kubernetes 1.30~~

Makefile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ VERSION ?= $(shell cat VERSION)
1515
CHART_VERSION ?= $(shell awk '/^version:/ {print $$2}' charts/csi-cloudscale/Chart.yaml)
1616
DOCKER_REPO ?= quay.io/cloudscalech/cloudscale-csi-plugin
1717

18-
all: check-unused test
18+
all: lint check-unused test
1919

2020
publish: build push clean
2121

@@ -60,12 +60,12 @@ check-unused:
6060
.PHONY: test
6161
test:
6262
@echo "==> Testing all packages"
63-
@GO111MODULE=on go test -v ./... $(TEST_ARGS)
63+
@GO111MODULE=on go test -race -v ./... $(TEST_ARGS)
6464

6565
.PHONY: test-integration
6666
test-integration:
6767
@echo "==> Started integration tests"
68-
@env GO111MODULE=on go test -count 1 -v $(TESTARGS) -tags integration -timeout 20m ./test/...
68+
@env GO111MODULE=on go test -race -count 1 -v $(TESTARGS) -tags integration -timeout 20m ./test/...
6969

7070
.PHONY: build
7171
build: compile
@@ -74,10 +74,10 @@ build: compile
7474

7575
.PHONY: push
7676
push:
77-
ifeq ($(DOCKER_REPO),cloudscalech/cloudscale-csi-plugin)
78-
ifneq ($(BRANCH),master)
77+
ifeq ($(DOCKER_REPO),quay.io/cloudscalech/cloudscale-csi-plugin)
78+
ifeq ($(filter master,$(BRANCH))$(filter release/%,$(BRANCH)),)
7979
ifneq ($(VERSION),dev)
80-
$(error "Only the `dev` tag can be published from non-master branches")
80+
$(error "Only the `dev` tag can be published from non-master/non-release branches")
8181
endif
8282
endif
8383
endif
@@ -93,3 +93,15 @@ clean:
9393
.PHONY: helm-template
9494
helm-template:
9595
@helm template csi-cloudscale -n kube-system --set nameOverride=csi-cloudscale ./charts/csi-cloudscale
96+
97+
## Development tooling
98+
99+
fmt: ## Run go fmt against code.
100+
go fmt ./...
101+
102+
vet: ## Run go vet against code.
103+
go vet ./...
104+
105+
.PHONY: lint
106+
lint: fmt vet ## Combined target to run linters
107+
go tool -modfile tool.mod golangci-lint run --timeout 2m0s ./...

README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ secret `my-pvc-luks-key`.
6161
## Releases
6262

6363
The cloudscale.ch CSI plugin follows [semantic versioning](https://semver.org/).
64-
The current version is: **`v3.5.6`**.
64+
The current version is: **`v3.5.7-rc2`**.
6565

6666
* Bug fixes will be released as a `PATCH` update.
6767
* New features (such as CSI spec bumps) will be released as a `MINOR` update.
@@ -89,14 +89,14 @@ We recommend using the latest cloudscale.ch CSI driver compatible with your Kube
8989
| 1.25 | v3.3.0 | v3.5.6 |
9090
| 1.26 | v3.3.0 | v3.5.6 |
9191
| 1.27 | v3.3.0 | v3.5.6 |
92-
| 1.28 | v3.3.0 | v3.5.6 |
93-
| 1.29 | v3.3.0 | v3.5.6 |
94-
| 1.30 | v3.3.0 | v3.5.6 |
95-
| 1.31 | v3.3.0 | v3.5.6 |
96-
| 1.32 | v3.3.0 | v3.5.6 |
97-
| 1.33 | v3.3.0 | v3.5.6 |
98-
| 1.34 [1] | v3.3.0 | v3.5.6 |
99-
| 1.35 | v3.4.1 | v3.5.6 |
92+
| 1.28 | v3.3.0 | v3.5.7-rc2 |
93+
| 1.29 | v3.3.0 | v3.5.7-rc2 |
94+
| 1.30 | v3.3.0 | v3.5.7-rc2 |
95+
| 1.31 | v3.3.0 | v3.5.7-rc2 |
96+
| 1.32 | v3.3.0 | v3.5.7-rc2 |
97+
| 1.33 | v3.3.0 | v3.5.7-rc2 |
98+
| 1.34 [1] | v3.3.0 | v3.5.7-rc2 |
99+
| 1.35 | v3.4.1 | v3.5.7-rc2 |
100100

101101
[1] Prometheus `kubelet_volume_stats_*` metrics not available in 1.34.0 and 1.34.1 due to a
102102
[bug in Kubelet](https://github.com/kubernetes/kubernetes/issues/133847). Fixed in `1.34.2`.
@@ -198,10 +198,10 @@ $ helm install -g -n kube-system --set controller.image.tag=dev --set node.image
198198
Before you continue, be sure to checkout to a [tagged
199199
release](https://github.com/cloudscale-ch/csi-cloudscale/releases).
200200
Always use the [latest stable version](https://github.com/cloudscale-ch/csi-cloudscale/releases/latest)
201-
For example, to use the latest stable version (`v3.5.6`) you can execute the following command:
201+
For example, to use the latest stable version (`v3.5.7-rc2`) you can execute the following command:
202202

203203
```
204-
$ kubectl apply -f https://raw.githubusercontent.com/cloudscale-ch/csi-cloudscale/master/deploy/kubernetes/releases/csi-cloudscale-v3.5.6.yaml
204+
$ kubectl apply -f https://raw.githubusercontent.com/cloudscale-ch/csi-cloudscale/master/deploy/kubernetes/releases/csi-cloudscale-v3.5.7-rc2.yaml
205205
```
206206

207207
The storage classes `cloudscale-volume-ssd` and `cloudscale-volume-bulk` will be created. The
@@ -421,15 +421,23 @@ $ git push origin
421421

422422
After it's merged to master, [create a new Github
423423
release](https://github.com/cloudscale-ch/csi-cloudscale/releases/new) from
424-
master with the version `v3.5.6` and then publish a new docker build:
424+
master with the version `v3.5.7-rc2` and then publish a new docker build:
425425

426426
```
427427
$ git checkout master
428428
$ make publish
429429
```
430430

431-
This will create a binary with version `v3.5.6` and docker image pushed to
432-
`cloudscalech/cloudscale-csi-plugin:v3.5.6`
431+
This will create a binary with version `v3.5.7-rc2` and docker image pushed to
432+
`cloudscalech/cloudscale-csi-plugin:v3.5.7-rc2`
433+
434+
### Release a pre-release version
435+
436+
To release a new pre-release (or a patch version based on an existing tag) version, follow the following steps:
437+
438+
1. create a new branch called `release/x.y` (or with the full version)
439+
2. push it to GitHub
440+
3. Follow the flow for creating a new release, making sure to set the appropriate versions.
433441

434442
## Contributing
435443

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.5.6
1+
v3.5.7-rc2

charts/csi-cloudscale/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: csi-cloudscale
33
description: A Container Storage Interface Driver for cloudscale.ch volumes.
44
type: application
5-
version: 1.3.6
6-
appVersion: "3.5.6"
5+
version: 1.3.7-rc2
6+
appVersion: "3.5.7-rc2"
77
home: https://github.com/cloudscale-ch/csi-cloudscale
88
sources:
99
- https://github.com/cloudscale-ch/csi-cloudscale.git

charts/csi-cloudscale/templates/daemonset.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
role: csi-cloudscale
1616
spec:
1717
priorityClassName: system-node-critical
18-
serviceAccount: {{ include "csi-cloudscale.node-service-account-name" . }}
18+
serviceAccountName: {{ include "csi-cloudscale.node-service-account-name" . }}
1919
hostNetwork: true
2020
containers:
2121
- name: csi-node-driver-registrar
@@ -53,6 +53,7 @@ spec:
5353
args :
5454
- "--endpoint=$(CSI_ENDPOINT)"
5555
- "--url=$(CLOUDSCALE_API_URL)"
56+
- "--log-level={{ .Values.node.logLevel }}"
5657
{{- with .Values.node.resources }}
5758
resources:
5859
{{ toYaml . | indent 12 }}

charts/csi-cloudscale/templates/rbac.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rules:
1818
verbs: ["list", "watch", "create", "update", "patch"]
1919
- apiGroups: ["snapshot.storage.k8s.io"]
2020
resources: ["volumesnapshots"]
21-
verbs: ["get", "list"]
21+
verbs: [ "get", "list", "watch", "update" ]
2222
- apiGroups: ["snapshot.storage.k8s.io"]
2323
resources: ["volumesnapshotcontents"]
2424
verbs: ["get", "list"]
@@ -40,9 +40,6 @@ rules:
4040
- apiGroups: [""]
4141
resources: ["persistentvolumes"]
4242
verbs: ["get", "list", "watch", "update", "patch"]
43-
- apiGroups: [""]
44-
resources: ["nodes"]
45-
verbs: ["get", "list", "watch"]
4643
- apiGroups: ["storage.k8s.io"]
4744
resources: ["csinodes"]
4845
verbs: ["get", "list", "watch"]
@@ -64,12 +61,18 @@ rules:
6461
- apiGroups: [""]
6562
resources: ["persistentvolumeclaims"]
6663
verbs: ["get", "list", "watch"]
64+
- apiGroups: [""]
65+
resources: ["pods"]
66+
verbs: ["get", "list", "watch"]
6767
- apiGroups: [""]
6868
resources: ["persistentvolumeclaims/status"]
6969
verbs: ["update", "patch"]
7070
- apiGroups: [""]
7171
resources: ["events"]
7272
verbs: ["list", "watch", "create", "update", "patch"]
73+
- apiGroups: ["storage.k8s.io"]
74+
resources: ["volumeattributesclasses"]
75+
verbs: ["get", "list", "watch"]
7376
---
7477
kind: ClusterRole
7578
apiVersion: rbac.authorization.k8s.io/v1

charts/csi-cloudscale/templates/statefulset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ spec:
7777
args :
7878
- "--endpoint=$(CSI_ENDPOINT)"
7979
- "--url=$(CLOUDSCALE_API_URL)"
80+
- "--log-level={{ .Values.controller.logLevel }}"
8081
{{- with .Values.controller.resources }}
8182
resources:
8283
{{ toYaml . | indent 12 }}

charts/csi-cloudscale/values.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ controller:
8484
image:
8585
registry: quay.io
8686
repository: cloudscalech/cloudscale-csi-plugin
87-
tag: v3.5.6
87+
tag: v3.5.7-rc2
8888
pullPolicy: IfNotPresent
8989
serviceAccountName:
90+
logLevel: info
9091
resources: {}
9192
# limits:
9293
# cpu: 100m
@@ -99,11 +100,12 @@ node:
99100
image:
100101
registry: quay.io
101102
repository: cloudscalech/cloudscale-csi-plugin
102-
tag: v3.5.6
103+
tag: v3.5.7-rc2
103104
pullPolicy: IfNotPresent
104105
nodeSelector: {}
105106
tolerations: []
106107
serviceAccountName:
108+
logLevel: info
107109
resources: {}
108110
# limits:
109111
# cpu: 100m

0 commit comments

Comments
 (0)