prototype for supporting per-CR Vault/S3 client construction - #27
Draft
travisbcotton wants to merge 2 commits into
Draft
travisbcotton wants to merge 2 commits into
travisbcotton wants to merge 2 commits into
Conversation
Signed-off-by: Travis Cotton <trcotton@lanl.gov>
travisbcotton
marked this pull request as draft
September 9, 2026 16:34
Signed-off-by: Travis Cotton <trcotton@lanl.gov>
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.
Description
What it does
Adds
vaultClientFor(ctx, cp)ands3ClientFor(ctx, cp)factory methods on the controller (new fileinternal/controller/clients.go) that build the clients per-CR fromspec.platform.*plus the Secrets that spec references, instead of from process-wide env vars. The controller calls them in bothreconcileAllandreconcileDelete.Key design decisions (all flagged in code comments for reviewers)
Struct fields become an optional override.
r.VaultClient/r.S3Clientare checked first in each factory. If set (unit tests inject fakes;make dev-runinjects env clients), they win. This is why the entire existing test suite passes untouched — no test changes needed.Graceful degradation preserved. Every failure path (missing spec, missing Secret, unreachable, auth failure) returns
(nil, nil), so the existing nil-guards invault.go/bucket.go/logbucket.goreport*Configured=False/*Ready=Falseand requeue — matching today's non-crashing semantics.S3 credentials reuse the existing convention. The factory reads the VSO-synced
openchami-<cluster>-s3-credentialsSecret (keysaccess_key/secret_key) — the same Secretbucket.go/logbucket.goalready fetch but never used. This closes the latent gap I found earlier.Added
spec.platform.objectStorage.region(CRD regenerated).Deliberately unresolved — (marked
OPEN QUESTIONSinclients.go)credentialsSecretRef.appRoleSecretRef(expectsrole_id/secret_idkeys) — needs confirmation that matches how operators populate that Secret.tokenauth: not expressible in the CRD enum, so dev still relies on the env-injected override.main.gois intentionally left as-is (dev keeps working).Fixes #15
Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryType of Change