Skip to content

Commit

Permalink
fix: Add automatic CSI registration path migration 23.1 -> 23.4 (#258)
Browse files Browse the repository at this point in the history
# Description

Fixes #251
  • Loading branch information
sbernauer committed Mar 30, 2023
1 parent bdc4462 commit d21476a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ All notable changes to this project will be documented in this file.
### Changed

- Shortened the registration socket path for Microk8s compatibility ([#231]).
- After upgrading you will need to
`rmdir /var/lib/kubelet/plugins_registry/secrets.stackable.tech-reg.sock` manually.
This applies to *all* users, not just Microk8s.
- The old CSI registration path will be automatically migrated during upgrade ([#258]).
- You might need to manually remove `/var/lib/kubelet/plugins_registry/secrets.stackable.tech-reg.sock` when downgrading
- Made kubeletDir configurable ([#232]).
- Microk8s users will need to `--set kubeletDir=/var/snap/microk8s/common/var/lib/kubelet`.

Expand All @@ -23,6 +22,7 @@ All notable changes to this project will be documented in this file.
[#232]: https://github.com/stackabletech/secret-operator/pull/232
[#252]: https://github.com/stackabletech/secret-operator/pull/252
[#257]: https://github.com/stackabletech/secret-operator/pull/257
[#258]: https://github.com/stackabletech/secret-operator/pull/258

## [23.1.0] - 2023-01-23

Expand Down Expand Up @@ -75,7 +75,7 @@ All notable changes to this project will be documented in this file.

- `autoTls` CA generation now requires opt-in ([#77]).
- The default `tls` `SecretClass` now has this opt-in by default.

### Removed

- `k8sSearch` backend's option `secretLabels` has been removed ([#123]).
Expand Down
23 changes: 23 additions & 0 deletions deploy/helm/secret-operator/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,29 @@ spec:
mountPath: /registration
- name: csi
mountPath: /csi
initContainers:
# https://github.com/stackabletech/secret-operator/issues/251
# In https://github.com/stackabletech/secret-operator/pull/231 we introduced a breaking change by shortening the CSI registration path
# This resulted in the following error "node_register.go:43] file exists in socketPath /registration/secrets.stackable.tech-reg.sock but it's not a socket.: &{name:secrets.stackable.tech-reg.sock size:4096 mode:2147484141 modTime:{wall:984732078ext:63815759330 loc:0xf864a0} sys:{Dev:64769 Ino:43688551 Nlink:2 Mode:16877 Uid:0 Gid:0 X__pad0:0 Rdev:0 Size:4096 Blksize:4096 Blocks:8 Atim:{Sec:1680162505 Nsec:36073186} Mtim:{Sec:1680162530 Nsec:984732078} Ctim:{Sec:1680162530 Nsec:984732078} X__unused:[0 0 0]}}"
# This init container removes the "old" directory, so that a unix socket with the same path can be created instead
# TODO: Should be removed in a release after 23.4
- name: migrate-longer-csi-registration-path
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /bin/bash
- -euo
- pipefail
- -x
- -c
- |
ls -la /registration
echo "Removing old (long) CSI registration path"
if [ -d "/registration/secrets.stackable.tech-reg.sock" ]; then rmdir /registration/secrets.stackable.tech-reg.sock; fi
ls -la /registration
volumeMounts:
- name: registration-sock
mountPath: /registration
volumes:
- name: registration-sock
hostPath:
Expand Down

0 comments on commit d21476a

Please sign in to comment.