feat(operator): give the SimplyblockDriver a TLS spec surface - #520
Merged
Merged
Conversation
Every deployment the chart rendered got TLS unconditionally under tls.enabled: simplyblock.tlsEnv, simplyblock.tlsVolumeMount, and simplyblock.clientTlsVolume on both plugins. The SimplyblockDriver kind that replaced the chart's rendering (#513) had no field for any of it, so adoption refused a deployment carrying it outright (workloads.go's TODO(simplyblockdriver)), and any cluster with tls.enabled=true had no way to move its CSI driver onto the new kind at all — confirmed live in simplyBlockDeployGCP: the e2e workflow had to drop TLS from its control plane just to exercise the new driver-adoption path. spec.tls (enableTLS, enableMutualTLS, provider) reproduces the three Helm values as one nested struct, following the same pattern spec.sidecarImages already set for a chart value that had to survive the move. The env, the volume, and the mount are byte-for-byte what the chart rendered — FDB_TLS_* included, even though neither plugin reads it — because workloads.go's own rule is that a Created deployment's objects have to match an already-running one for adoption to be a no-op rather than a rolling restart. The client-certificate Secret each plugin mounts is derived, not a spec field: <object name>-csi-{controller,node}-client-tls, the same names.go pattern every other object already follows, and the literal names this chart's controlplane_certificates.yaml already writes for cert-manager. A field naming them again would be a second place for the two to disagree. Adoption's TLS refusal is now a comparison rather than a blanket no, the same shape as the existing driverName check: the running node plugin's SB_TLS_CONNECT is compared against what spec.tls would produce, and only a disagreement refuses. Unlike driverName, this one is repairable — an administrator edits spec.tls to describe what is actually running, and the next reconcile adopts. Generated: the CRD, deepcopy, the chart's copy, dist/install.yaml. The design document and its test plan are updated in the same change (12 new unit rows, all covered). The api-design checker's foreign-value allow-list gained "cert-manager", alongside its existing ext4/tcp entries: a product's own name is the one exception to this API group's PascalCase enum rule, and cert-manager's is lowercase-hyphenated the same way tls.provider already spells it everywhere else in this operator. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bring the branch up to date with main, which has moved nine commits ahead since this work started. The only conflict was in operator/api/v1alpha2/zz_generated.deepcopy.go, where main's new JournalManagerSpec and this branch's DriverTLS land at the same place in controller-gen's alphabetical ordering. It is generated, so the conflict was resolved by regenerating rather than by editing the file: both types are present in the result. Regenerated with `make -C operator manifests generate`, `make helm-sync`, and `make -C operator build-installer`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147krXZiYYiV58cvpzpi2ob
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#513 moved the CSI driver's deployment out of the Helm chart and into the
SimplyblockDriverkind the operator reconciles — but the new kind had no field for TLS, so adoption refused any deployment carrying it outright:That's not a hypothetical gap. In simplyBlockDeployGCP's e2e workflow, I had to explicitly drop
--set tls.enabled=true --set tls.mutual_enabled=truefrom the Helm install just to get the new driver-adoption path to work at all — any cluster running with TLS on had no way to move its CSI driver ontoSimplyblockDriver.What this does
spec.tls(enableTLS,enableMutualTLS,provider) reproduces the chart'stls.enabled/tls.mutual_enabled/tls.provideras one nested struct — the same patternspec.sidecarImagesalready established for a chart value that had to survive the move to a CRD.The env, the volume, and the mount it produces are byte-for-byte what the chart rendered (
FDB_TLS_*included, even though neither plugin reads it), becauseworkloads.go's own rule is that aCreateddeployment's objects have to match an already-running one, or adoption becomes a rolling restart instead of a no-op.The client-certificate Secret each plugin mounts is derived, not a spec field:
<object name>-csi-{controller,node}-client-tls, the samenames.gopattern every other object already follows, and the literal names this chart'scontrolplane_certificates.yamlalready writes for cert-manager. A field naming them again would just be a second place for the two to disagree.Adoption's TLS refusal is now a comparison, not a blanket no — the same shape as the existing
driverNamecheck: the running node plugin'sSB_TLS_CONNECTis compared against whatspec.tlswould produce, and only a disagreement refuses. UnlikedriverName, this one is repairable: editspec.tlsto describe what's actually running, and the next reconcile adopts.Verification
go build ./...,go vet ./...,go test ./...clean (one unrelated pre-existingenvtestfailure ininternal/controllerfrom a missing localetcdbinary — confirmed pre-existing by stashing this change and re-running).check-crds.py --pathsandcheck-reconcilers.py --paths: 0 errors.xfs/XFSnote in a comment I didn't touch — it's intentionally lowercase there, quoting a literal enum value).make -C operator manifests generate,make helm-sync,make -C operator build-installer: regenerated CRD, deepcopy, chart copy,dist/install.yaml. No side effect onconfig/manager/kustomization.yaml.tls.go's builders, plus 5 new adoption-mismatch cases), all passing.design-simplyblockdriver.md) and test plan (test-plan-simplyblockdriver.md) updated in the same change, per this repo's API-design checklist.Side note
The api-design checker's foreign-value allow-list (
check-crds.py) gainedcert-manageralongside its existingext4/tcpentries — a product's own name is the documented exception to this group's PascalCase enum rule, andcert-manageris lowercase-hyphenated the same waytls.provideralready spells it everywhere else in this operator (internal/utils/tls.go's existingTLSProviderCertManagerconstant).🤖 Generated with Claude Code