Skip to content

Commit d21476a

Browse files
committed
fix: Add automatic CSI registration path migration 23.1 -> 23.4 (#258)
# Description Fixes #251
1 parent bdc4462 commit d21476a

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ All notable changes to this project will be documented in this file.
1212
### Changed
1313

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

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

2727
## [23.1.0] - 2023-01-23
2828

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

7676
- `autoTls` CA generation now requires opt-in ([#77]).
7777
- The default `tls` `SecretClass` now has this opt-in by default.
78-
78+
7979
### Removed
8080

8181
- `k8sSearch` backend's option `secretLabels` has been removed ([#123]).

deploy/helm/secret-operator/templates/daemonset.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,29 @@ spec:
7474
mountPath: /registration
7575
- name: csi
7676
mountPath: /csi
77+
initContainers:
78+
# https://github.com/stackabletech/secret-operator/issues/251
79+
# In https://github.com/stackabletech/secret-operator/pull/231 we introduced a breaking change by shortening the CSI registration path
80+
# 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]}}"
81+
# This init container removes the "old" directory, so that a unix socket with the same path can be created instead
82+
# TODO: Should be removed in a release after 23.4
83+
- name: migrate-longer-csi-registration-path
84+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
85+
imagePullPolicy: {{ .Values.image.pullPolicy }}
86+
command:
87+
- /bin/bash
88+
- -euo
89+
- pipefail
90+
- -x
91+
- -c
92+
- |
93+
ls -la /registration
94+
echo "Removing old (long) CSI registration path"
95+
if [ -d "/registration/secrets.stackable.tech-reg.sock" ]; then rmdir /registration/secrets.stackable.tech-reg.sock; fi
96+
ls -la /registration
97+
volumeMounts:
98+
- name: registration-sock
99+
mountPath: /registration
77100
volumes:
78101
- name: registration-sock
79102
hostPath:

0 commit comments

Comments
 (0)