fix(linstor): run the NFS server wait init container on the platform CSI image (#5358)

## What this PR does

Closes #5307

The LinstorCluster in `packages/system/linstor/templates/cluster.yaml`
had no `nfsServer.podTemplate`. The NFS server DaemonSet's
`linstor-wait-node-online` init container therefore ran
piraeus-operator's default `quay.io/piraeusdatastore/piraeus-csi` image,
at the operator's own tag. Every other container on the CSI image is
pinned to `linstorCSI.image`.

Changes:
- Adds `nfsServer.podTemplate`, which pins that init container to `{{
.Values.linstorCSI.image.repository }}:{{ .Values.linstorCSI.image.tag
}}`, the same way `csiNode` pins its `linstor-wait-node-online`.
- Sets `nfsServer.enabled: true` explicitly. In piraeus-operator
v2.12.1, `ComponentSpec.IsEnabled()` is `c == nil || c.Enabled`. An
absent `nfsServer` is enabled today, and the CRD also defaults `enabled`
to `true`. Stating it keeps the DaemonSet deployed exactly as now and
doesn't rely on that default.
- Adds a helm-unittest case in `tests/linstor_test.yaml`, next to the
existing CSI image pins. It checks that the init container's image is
the cozystack-built `linstor-csi` and that `nfsServer.enabled` is
`true`.

I checked the container name against upstream
`pkg/resources/cluster/nfs-server/nfs-server-daemon-set.yaml` at
v2.12.1, the vendored operator version. The operator applies
`podTemplate` as a strategic merge patch keyed on the container name
(see `ComponentPodTemplate("DaemonSet", "linstor-csi-nfs-server",
...)`), so only the image changes.

### How I checked it

- `helm unittest .` in `packages/system/linstor`: 6 suites and 25 tests
pass. With the template change reverted, the new case fails.
- `helm template` renders `nfsServer` with the pinned
`ghcr.io/cozystack/cozystack/linstor-csi:v1.6.0@sha256:…` image.
- I haven't tried it on a running cluster.

### Screenshots

Not a UI change.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

This only changes one rendered LinstorCluster field in
`packages/system/linstor`. No values keys, images or versions change.

### Release note

```release-note
fix(linstor): the NFS server's linstor-wait-node-online init container now runs the platform-built linstor-csi image instead of the operator's default.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* LINSTOR clusters now enable the NFS server. Its startup check uses the
image repository and tag configured for LINSTOR CSI, including when
those values are overridden.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Aleksei Sviridkin authored and GitHub committed 2026-11-23 14:59:53 +03:00
commit 7d64fb7a53
2 files changed
+39

No files matched your search

@@ -138,6 +138,17 @@ spec:
containers:
- name: linstor-csi
image: {{ .Values.linstorCSI.image.repository }}:{{ .Values.linstorCSI.image.tag }}
{{- /* The NFS server DaemonSet runs one init container on the CSI image.
Left unset it follows the operator's default image and tag, not
linstorCSI.image. An absent nfsServer means enabled to the operator,
so enabled is stated explicitly to keep that unchanged. */}}
nfsServer:
enabled: true
podTemplate:
spec:
initContainers:
- name: linstor-wait-node-online
image: {{ .Values.linstorCSI.image.repository }}:{{ .Values.linstorCSI.image.tag }}
patches:
- target:
kind: Deployment
@@ -16,6 +16,34 @@ tests:
path: spec.csiController.podTemplate.spec.containers[0].image
pattern: '^ghcr\.io/cozystack/cozystack/linstor-csi:[^@]+@sha256:[0-9a-f]{64}$'
- it: pins the NFS server's wait-node-online init container to the cozystack-built CSI image
template: templates/cluster.yaml
documentSelector:
path: kind
value: LinstorCluster
asserts:
- matchRegex:
path: spec.nfsServer.podTemplate.spec.initContainers[?(@.name=="linstor-wait-node-online")].image
pattern: '^ghcr\.io/cozystack/cozystack/linstor-csi:[^@]+@sha256:[0-9a-f]{64}$'
- equal:
path: spec.nfsServer.enabled
value: true
- it: the NFS server's wait-node-online init container follows linstorCSI.image
template: templates/cluster.yaml
documentSelector:
path: kind
value: LinstorCluster
set:
linstorCSI:
image:
repository: registry.example/linstor-csi
tag: v0.0.0-test
asserts:
- equal:
path: spec.nfsServer.podTemplate.spec.initContainers[?(@.name=="linstor-wait-node-online")].image
value: registry.example/linstor-csi:v0.0.0-test
- it: pins the satellite to the cozystack-built piraeus-server image
template: templates/satellites-cozy.yaml
documentSelector: