Repository navigation
CKS: split the glued document separator in the CSI driver manifest - #14914
bhouse-nexthop wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14914 +/- ##
============================================
- Coverage 18.34% 18.33% -0.01%
+ Complexity 16671 16669 -2
============================================
Files 5939 5939
Lines 537817 537817
Branches 65938 65938
============================================
- Hits 98640 98622 -18
- Misses 427954 427972 +18
Partials 11223 11223
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:
|
The manifest.yaml of cloudstack-csi-driver v3.0.0, which the binaries
ISO builder downloads, ends line 121 with the document separator:
apiGroup: rbac.authorization.k8s.io---
That merges the cloudstack-csi-snapshotter-binding ClusterRoleBinding
into the CSIDriver document that follows it. The API server refuses
the merged document, so deploy-csi-driver's kubectl apply fails and a
cluster created with the CSI driver has neither the CSIDriver object
nor that binding. The failure is not reported: the script's retry
finds the controller pod from the partial apply and exits 0, so any
other apply failure would be hidden the same way.
Put the separator on a line of its own when the control node copies
the manifest from the ISO. This covers clusters on ISOs that were
already built. On a manifest without the glued separator the sed
changes nothing.
Signed-off-by: Brad House <bhouse@nexthop.ai>
40cb164 to
08a9c41
Compare
|
Tested on a KVM lab running a main (24.0) build. Primary storage is Ceph RBD. Each CKS cluster is Kubernetes 1.33.1 from an ISO built by Result: both runs passed all of their checks, 13 of 13 each. The control reproduces the bug, and the change fixes it.
The snapshot works in both runs, as the corrected description says: Rendered control node user data: 25,809 bytes before, 26,138 bytes with the change. Both clusters, with their volumes and snapshots, were deleted afterwards. Not tested: 4.22, and an ISO without the CSI files (the download fallback in |
Description
Correction: an earlier version of this text said volume snapshots fail. They shouldn't:
cloudstack-csi-controller-role, bound to the same ServiceAccount, already grants the snapshot permissions, and the CSIDriver's spec equals the Kubernetes defaults. What is wrong is that the CSI deploy step fails and the failure is hidden, and the cluster lacks the CSIDriver object and the binding.A CKS cluster created with the CSI driver has no
CSIDriverobject and nocloudstack-csi-snapshotter-bindingClusterRoleBinding, although both are in the manifest. The cause is in the cloudstack-csi-driver v3.0.0manifest.yamlthat the ISO builder downloads: line 121 ends with the document separator (apiGroup: rbac.authorization.k8s.io---), which merges the binding into the CSIDriver document. The API server refuses that document and kubectl applies the rest:Nothing reports it, and any other apply failure would be hidden the same way.
deploy-csi-driverfails, CloudStack re-copies the scripts and runs it again, and the second run exits 0 at its first line because the controller pod from the partial apply exists.The control node now puts the separator on a line of its own when it copies
manifest.yamlfrom the ISO to/opt/csi(commit 08a9c41). The fix sits there, not in the ISO builder, so it also covers clusters created from ISOs that were already built. On a manifest without the glued separator thesedchanges nothing, so it keeps working once the driver ships a fixed release. The driver's release workflow still produces the glued separator; that is reported there separately.Not covered: the download fallback in
deploy-csi-driver(ISO without CSI files) fetches the same file. On 4.22 that fallback never applies the manifest at all (#14597, fixed by #14598). Changing it here would conflict with #14598.Fixes: #14913
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
setup-kube-system, taken from the edited cloud-config, on the v3.0.0manifest.yaml. Only line 121 changes: the file parses as 12 documents instead of 11, andClusterRoleBinding/cloudstack-csi-snapshotter-bindingis back. On a manifest with the separator already on its own line, the output is byte-identical to the input.kubectl applyof the v3.0.0 manifest fails with the error above and creates neither object. Applying the split manifest creates both, and everything else is unchanged.bash -non the extracted script passes.How did you try to break this feature and the system with this change?
----lines and lines that already hold only---are left alone.{{,{%or{#, and the Java side only replaces its own{{ ... }}keys.