Skip to content

Commit

Permalink
update csi for 1.30 (#571)
Browse files Browse the repository at this point in the history
* update csi for 1.30

* update makefile runner targets

* disable toolchain

* remove references to k8s 1.26

* README: edit e2e test description

* change go version to 1.22

* .github: skip checking unused in the CI

* go.mod: add go toolchain

* check go mod in the ci

* go.mod: change go directive back to 1.22.0
  • Loading branch information
dhij authored Apr 26, 2024
1 parent 48e3ec6 commit 8d2efb1
Show file tree
Hide file tree
Showing 445 changed files with 6,725 additions and 2,346 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
run: |
BRANCH=$(echo -n ${BRANCH} | tr -c '[:alnum:]._-' '-')
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USER}'", "password": "'${DOCKER_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
images=("${BRANCH}-latest" "${BRANCH}-runtime" "${BRANCH}-tools" "${BRANCH}-tests-1.29" "${BRANCH}-tests-1.28" "${BRANCH}-tests-1.27" "${BRANCH}-tests-1.26" "${BRANCH}-builder")
images=("${BRANCH}-latest" "${BRANCH}-runtime" "${BRANCH}-tools" "${BRANCH}-tests-1.30" "${BRANCH}-tests-1.29" "${BRANCH}-tests-1.28" "${BRANCH}-tests-1.27" "${BRANCH}-builder")
for i in ${images[*]}; do curl --fail -sS -X DELETE -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/digitalocean/k8s-e2e-test-runner/tags/$i/; done
curl --fail -sS -X DELETE -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/digitalocean/do-csi-plugin-dev/tags/${BRANCH}/
7 changes: 5 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ jobs:
with:
go-version-file: go.mod

- name: Check go mod and vendor
run: make check-unused

- name: Run unit tests
run: make all
run: make test

push-images:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -90,7 +93,7 @@ jobs:
strategy:
fail-fast: false
matrix:
kube-release: ['1.29', '1.28', '1.27', '1.26']
kube-release: ['1.30', '1.29', '1.28', '1.27']

steps:
- name: checkout
Expand Down
42 changes: 18 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ifneq ($(VERSION),)
else
VERSION ?= $(shell cat VERSION)
endif
KUBERNETES_VERSION ?= 1.29.0
KUBERNETES_VERSION ?= 1.30.0
DOCKER_REPO ?= digitalocean/do-csi-plugin
CANONICAL_RUNNER_IMAGE = digitalocean/k8s-e2e-test-runner
RUNNER_IMAGE ?= $(CANONICAL_RUNNER_IMAGE)
Expand Down Expand Up @@ -130,14 +130,14 @@ runner-build:
@echo "pulling cache images"
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder || true
@docker pull $(CANONICAL_RUNNER_IMAGE):builder || true
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.30 || true
@docker pull $(CANONICAL_RUNNER_IMAGE):tests-1.30 || true
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.29 || true
@docker pull $(CANONICAL_RUNNER_IMAGE):tests-1.29 || true
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.28 || true
@docker pull $(CANONICAL_RUNNER_IMAGE):tests-1.28 || true
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.27 || true
@docker pull $(CANONICAL_RUNNER_IMAGE):tests-1.27 || true
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.26 || true
@docker pull $(CANONICAL_RUNNER_IMAGE):tests-1.26 || true
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tools || true
@docker pull $(CANONICAL_RUNNER_IMAGE):tools || true
@docker pull $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)runtime || true
Expand All @@ -151,10 +151,20 @@ runner-build:
--cache-from $(CANONICAL_RUNNER_IMAGE):builder \
-t $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder -f test/e2e/Dockerfile test/e2e

@echo "building target tests-1.30"
@docker build --target tests-1.30 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder \
--cache-from $(CANONICAL_RUNNER_IMAGE):builder \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.30 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.30 \
-t $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.30 -f test/e2e/Dockerfile test/e2e

@echo "building target tests-1.29"
@docker build --target tests-1.29 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder \
--cache-from $(CANONICAL_RUNNER_IMAGE):builder \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.30 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.30 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.29 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.29 \
-t $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.29 -f test/e2e/Dockerfile test/e2e
Expand All @@ -163,6 +173,8 @@ runner-build:
@docker build --target tests-1.28 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder \
--cache-from $(CANONICAL_RUNNER_IMAGE):builder \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.30 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.30 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.29 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.29 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.28 \
Expand All @@ -173,6 +185,8 @@ runner-build:
@docker build --target tests-1.27 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder \
--cache-from $(CANONICAL_RUNNER_IMAGE):builder \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.30 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.30 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.29 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.29 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.28 \
Expand All @@ -181,20 +195,6 @@ runner-build:
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.27 \
-t $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.27 -f test/e2e/Dockerfile test/e2e

@echo "building target tests-1.26"
@docker build --target tests-1.26 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder \
--cache-from $(CANONICAL_RUNNER_IMAGE):builder \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.29 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.29 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.28 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.28 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.27 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.27 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.26 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.26 \
-t $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.26 -f test/e2e/Dockerfile test/e2e

@echo "building target tools"
@docker build --target tools \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder \
Expand All @@ -205,8 +205,6 @@ runner-build:
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.28 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.27 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.27 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.26 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.26 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tools \
--cache-from $(CANONICAL_RUNNER_IMAGE):tools \
-t $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tools -f test/e2e/Dockerfile test/e2e
Expand All @@ -221,8 +219,6 @@ runner-build:
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.28 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.27 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.27 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.26 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.26 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tools \
--cache-from $(CANONICAL_RUNNER_IMAGE):tools \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)runtime \
Expand All @@ -239,8 +235,6 @@ runner-build:
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.28 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.27 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.27 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.26 \
--cache-from $(CANONICAL_RUNNER_IMAGE):tests-1.26 \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tools \
--cache-from $(CANONICAL_RUNNER_IMAGE):tools \
--cache-from $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)runtime \
Expand All @@ -251,10 +245,10 @@ runner-build:

runner-push: runner-build
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)builder
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.30
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.29
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.28
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.27
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tests-1.26
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)tools
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)runtime
@docker push $(RUNNER_IMAGE):$(RUNNER_IMAGE_TAG_PREFIX)latest
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ The following table describes the required DigitalOcean CSI driver version per s
| 1.27 | v4.6.0+ |
| 1.28 | v4.7.0+ |
| 1.29 | v4.8.0+ |
| 1.30 | v4.9.0+ |

---
**Note:**
Expand Down Expand Up @@ -349,24 +350,18 @@ make test

### End-to-End Tests

To manually run the end-to-end tests, you need to build a container image for your change first and publish it to a registry. Repository owners can publish under `digitalocean/do-csi-plugin:dev`:

```shell
VERSION=dev make publish
```

If you do not have write permissions to `digitalocean/do-csi-plugin` on Docker Hub or are worried about conflicting usage of that tag, you can also publish under a different (presumably personal) organization:

```shell
DOCKER_REPO=johndoe VERSION=latest-feature make publish
DOCKER_REPO=johndoe/do-csi-plugin VERSION=latest-feature make publish
```

This would yield the published container image `johndoe/do-csi-plugin:latest-feature`.

Assuming you have your DO API token assigned to the `DIGITALOCEAN_ACCESS_TOKEN` environment variable, you can then spin up a DOKS cluster on-the-fly and execute the upstream end-to-end tests for a given set of Kubernetes versions like this:

```shell
make test-e2e E2E_ARGS="-driver-image johndoe/do-csi-plugin:latest-feature 1.16 1.15 1.14"
make test-e2e E2E_ARGS="-driver-image johndoe/do-csi-plugin:latest-feature 1.30 1.29 1.28"
```

See [our documentation](test/e2e/README.md) for an overview on how the end-to-end tests work as well as usage instructions.
Expand Down
10 changes: 5 additions & 5 deletions deploy/kubernetes/releases/csi-digitalocean-dev/driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ spec:
serviceAccount: csi-do-controller-sa
containers:
- name: csi-provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v3.6.3
image: registry.k8s.io/sig-storage/csi-provisioner:v4.0.1
args:
- "--csi-address=$(ADDRESS)"
- "--default-fstype=ext4"
Expand All @@ -124,7 +124,7 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-attacher
image: registry.k8s.io/sig-storage/csi-attacher:v4.4.3
image: registry.k8s.io/sig-storage/csi-attacher:v4.5.1
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
Expand All @@ -138,7 +138,7 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-snapshotter
image: registry.k8s.io/sig-storage/csi-snapshotter:v6.3.3
image: registry.k8s.io/sig-storage/csi-snapshotter:v7.0.2
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
Expand All @@ -150,7 +150,7 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-resizer
image: registry.k8s.io/sig-storage/csi-resizer:v1.9.3
image: registry.k8s.io/sig-storage/csi-resizer:v1.10.1
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=30s"
Expand Down Expand Up @@ -398,7 +398,7 @@ spec:
mountPath: /etc/udev/rules.d/
containers:
- name: csi-node-driver-registrar
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.9.3
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.1
args:
- "--v=5"
- "--csi-address=$(ADDRESS)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
serviceAccountName: snapshot-controller
containers:
- name: snapshot-controller
image: registry.k8s.io/sig-storage/snapshot-controller:v6.3.3
image: registry.k8s.io/sig-storage/snapshot-controller:v7.0.2
args:
- "--v=5"
imagePullPolicy: IfNotPresent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
serviceAccountName: snapshot-validation
containers:
- name: snapshot-validation
image: registry.k8s.io/sig-storage/snapshot-validation-webhook:v6.3.3
image: registry.k8s.io/sig-storage/snapshot-validation-webhook:v7.0.2
imagePullPolicy: IfNotPresent
args: ['--tls-cert-file=/etc/snapshot-validation-webhook/certs/cert.pem', '--tls-private-key-file=/etc/snapshot-validation-webhook/certs/key.pem']
ports:
Expand Down
Loading

0 comments on commit 8d2efb1

Please sign in to comment.