Files
cozystack/packages/core/platform
Aleksei Sviridkin 054b4ef4bc fix(linstor): gate group snapshots on the v1 group snapshot API (#5430)
## What this PR does

The linstor group snapshot gate and the linstor
`VolumeGroupSnapshotClass` were tied to
`groupsnapshot.storage.k8s.io/v1beta2`, on the grounds that
piraeus-operator probes v1beta2. On main it does not: piraeus-operator
v2.12.1 probes v1, csi-snapshotter v8.7.0 reads the content and class
kinds at v1, and snapshot-controller v8.7.0 watches all three kinds at
v1. The vendored chart serves v1, v1beta1 and v1beta2 today, so nothing
is broken yet, but once upstream stops serving v1beta2 the gate would
turn group snapshots off while every component that acts on them could
still use them.

The first commit gates on v1 and moves the class to v1. It also replaces
the comment that said csi-snapshotter stalls when the gate is on and the
API is missing: v8.7.0 logs a warning and runs without group snapshots.
Velero 1.18 reads group snapshots at v1beta2, so the vm-instance hook,
which gates on v1beta2 for Velero, stays as it is.

The second commit rewrites the snapshot-controller CRD test. It pinned
the vendored chart's layout (six CRD documents, v1beta2 as the storage
version, no v1alpha1) and would go red on a correct `make update` that
moves storage to v1. It now asserts what the platform needs: every group
snapshot CRD serves v1 and v1beta2, the three volume snapshot CRDs are
rendered, and every rendered CRD is kept on uninstall.

On upgrade, an install running the CRDs from this chart sees no change
in the gate and no csi-controller rollout. The class is updated in
place, since Helm matches release objects by group and kind. The only
install that flips is one whose distribution ships group snapshot CRDs
with v1beta2 but not v1: the gate goes from on to off and the class is
removed, and csi-snapshotter there was already disabling the feature at
startup.

I left the `-eq 3` check in the platform `image-migrations` target
alone. It stops an image from shipping where migration 62 deletes the
old CRDs and has nothing to recreate them from; asserting the three file
names instead would copy the list migration 62 already holds, and the
count fails loudly if upstream adds a CRD.

Tested with `helm unittest` on `packages/system/linstor` and
`packages/system/snapshot-controller`. I also checked that the new CRD
test fails when v1 or v1beta2 stops being served, when `keepCRDs` is
false, and when no CRD renders. Nothing was run against a 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:

### Release note

```release-note
fix(linstor): enable volume group snapshots based on the groupsnapshot.storage.k8s.io/v1 API that csi-snapshotter and snapshot-controller use, so they keep working once upstream stops serving v1beta2.
```


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

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* LINSTOR group snapshot support now uses the stable
`groupsnapshot.storage.k8s.io/v1` API when all required resources are
available.
* Group snapshot resources are served through both v1 and v1beta2,
supporting components that use either API version.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 19:52:11 +03:00
..