Repository navigation
Allow snapshots of CKS node and Shared FileSystem VM volumes - #14901
bhouse-nexthop wants to merge 1 commit into
Conversation
The guard that refuses snapshots of volumes built from a SYSTEM template checked "!CKS_NODE || !SHAREDFSVM". No VM is both, so the check was always true and volumes of CKS nodes and Shared FileSystem VMs were refused, both for snapshots and for snapshot policies. Use && as the deploy check in UserVmManagerImpl does. Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14901 +/- ##
============================================
- Coverage 18.34% 18.33% -0.01%
- Complexity 16671 16675 +4
============================================
Files 5939 5939
Lines 537817 537817
Branches 65938 65938
============================================
- Hits 98640 98634 -6
- Misses 427954 427957 +3
- Partials 11223 11226 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tested on a KVM lab running a main (24.0) build, first without this change and then with it. Primary storage is Ceph RBD. The CKS cluster is Kubernetes 1.33.1 on the default (SYSTEM-type) system VM template, 1 control and 1 worker node. The same cluster was kept across the upgrade.
All checks gave the expected result: 7 of 7 without the change, 9 of 9 with it. The snapshot, the policy and the cluster were deleted afterwards. Not tested: Shared FileSystem VM volumes (unit tests only), and a snapshot of a volume created from a CKS node snapshot. |
Description
Fixes #14900
Volume snapshots and snapshot policies are refused for CKS node volumes built from the SYSTEM-type system VM template (the CKS default), with "Creating snapshot against System VM volumes is not supported". Shared FileSystem VM root volumes are refused the same way.
The guard in
VolumeApiServiceImpl.isOperationSupportedandSnapshotManagerImpl.createPolicywas:No VM is both types, so it was always true. #9208 added the
SHAREDFSVMterm to exempt Shared FileSystem VMs as well, as it did in the deploy check inUserVmManagerImpl(!CKS_NODE.equals(vmType) && !SHAREDFSVM.equals(vmType)), but with||it removed the CKS exemption instead. This changes||to&&in both places.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
VolumeApiServiceImplTestandSnapshotManagerImplTest: 192 passed. Without the fix the 4 "allowed" tests fail.How did you try to break this feature and the system with this change?