Skip to content

[Merged by Bors] - fix: Add automatic CSI registration path migration 23.1 -> 23.4 #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ 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`.

[#99]: https://github.com/stackabletech/secret-operator/pull/99
[#231]: https://github.com/stackabletech/secret-operator/pull/231
[#232]: https://github.com/stackabletech/secret-operator/pull/232
[#252]: https://github.com/stackabletech/secret-operator/pull/252
[#258]: https://github.com/stackabletech/secret-operator/pull/258

## [23.1.0] - 2023-01-23

Expand Down Expand Up @@ -74,7 +74,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
21 changes: 21 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,27 @@ 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
- -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