bhouse-nexthop opened a new pull request, #14914:
URL: https://github.com/apache/cloudstack/pull/14914
### Description
A CKS cluster created with the CSI driver has no `CSIDriver` object and no
`cloudstack-csi-snapshotter-binding` ClusterRoleBinding, so CSI volume
snapshots can't work. The cause is in the cloudstack-csi-driver v3.0.0
`manifest.yaml` that 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:
```
Error from server (BadRequest): error when creating
"/opt/csi/manifest.yaml": CSIDriver in version "v1" cannot be handled as a
CSIDriver: strict decoding error: unknown field "roleRef", unknown field
"subjects"
```
Nothing reports it. `deploy-csi-driver` fails, 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.yaml` from the ISO to `/opt/csi` (commit 40cb164e71). 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 the `sed`
changes 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
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### How Has This Been Tested?
- Ran the CSI block of `setup-kube-system`, taken from the edited
cloud-config, on the v3.0.0 `manifest.yaml`. Only line 121 changes: the file
parses as 12 documents instead of 11, and
`ClusterRoleBinding/cloudstack-csi-snapshotter-binding` is back. On a manifest
with the separator already on its own line, the output is byte-identical to the
input.
- On a Kubernetes v1.33 cluster with the snapshot CRDs: `kubectl apply` of
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 -n` on the extracted script passes.
- A CKS cluster created with the CSI driver on a KVM test environment:
report to follow.
#### How did you try to break this feature and the system with this change?
- Comment lines, `----` lines and lines that already hold only `---` are
left alone.
- The cloud-config is a Jinja template: the line has no `{{`, `{%` or `{#`,
and the Java side only replaces its own `{{ ... }}` keys.
- The step only runs when the ISO has the CSI files, in the same block as
the copy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]