Skip to content

feat(connectivity): copy pull secrets and manage shared plugin policy - #562

Draft
Dav-14 wants to merge 4 commits into
mainfrom
codex/registry-pull-secret-references
Draft

Dav-14 wants to merge 4 commits into
mainfrom
codex/registry-pull-secret-references

Conversation

@Dav-14

@Dav-14 Dav-14 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Connectivity Core/API already resolve registry rewrites and pullSecret parameters, but the credentials must exist in the Stack namespace. Reuse that configuration to provision Stack-owned ResourceReferences without changing image parsing or registry behavior. These source-linked references keep rotating for the Stack lifetime: removing Connectivity or changing its registry must not remove credentials still used by Ledger/Auth. Obsolete Core/API references require explicit cleanup after checking consumers.

Plugins need their own explicit source because Stack Operator does not resolve their Catalog images. Add one Setting, connectivity.instances.image-pull-secrets, accepting one source Secret name. Stack Operator creates one stable reference per configured Stack and fixes the destination to ghcr-pull-connectivity-plugins. It also manages one shared plugins Policy with a stable name, targeting only configured Stack namespaces through instanceSelector and leaving Core/API untouched.

existing registry pullSecret ── Core/API ResourceReference ── same-name Secret ── existing Core/API injection
plugins source Setting ──────── per-Stack ResourceReference ─ ghcr-pull-connectivity-plugins
                                                                       ↑
                                              one shared plugins Policy

Add optional ResourceReference.spec.targetName, with existing source-name behavior when omitted. Preserve source authorization and reject unmanaged or incompatible destination writers. Core/API copies retain the configured names; plugin source changes keep their reference and destination stable; an empty per-stack Setting overrides a wildcard. No new Core/API Setting or Policy, generic registry auto-copy feature, Catalog inference, or external Connectivity Operator changes.

Tracks EN-3215. Sandbox cleanup: MR !166 removes only the Connectivity Operator imagePullSecrets from the Regions HelmRelease. It leaves Secrets and Catalogs unchanged and does not depend on this feature. This PR remains needed for clients using private registries.

Evidence

  • Before: registry pull-secret injection did not provision namespace copies; plugin runtime credentials needed manual per-Stack configuration.
    After: Core/API reuse their existing registry configuration; one plugin Setting provisions copies and one shared Policy.
  • Final local commit: f55545e473a8c2ba398b72e657b7875c709bfb1f.
  • Focused unit tests passed for Connectivity, ResourceReference, Stacks and Settings. Regressions cover 30 Stacks producing ONE Policy, replay idempotence, wildcard/empty override, last Setting/Stack deletion, drift/collisions, stable plugin destinations, authorization/rotation, and Core/API credential bootstrap.
  • Core/API lifecycle regression passed: Stack ownership, retained copies after Connectivity removal/configuration changes, continued source rotation, and stable reference identity after module recreation.
  • Focused envtest on Kubernetes 1.32.0 passed (ResourceReferences, plugin copies and shared Policy controller). Full just pre-commit passed with verified Go 1.27.3, golangci-lint 2.15.0 and Kustomize 4.5.7, including generation, three lint runs, Helm rendering and documentation/catalog generation.
  • Independent tests compiled and exercised the actual Connectivity Policy resolvers on both main and beta.3: allowed/excluded namespaces, deletion and unchanged Core/API credentials passed. The registry package and existing registry Chainsaw scenario have no diff against the feature base.
  • Independent final Principal Engineer, Product Engineer and SRE review: PASS for code preparation at f55545e4; the prior Core/API lifetime blocker is resolved. The reviewer also independently reran the four focused unit packages successfully.
  • Full integration suite and Chainsaw matrix were not run locally. Published-head CI passed Dirty and all five E2E jobs (Kubernetes 1.31–1.35). Tests/Test failed in the Ledger v3 CA-rotation assertion (old hash retained for 20 seconds). Static diagnosis suggests a possible pre-existing Secret-cache/Certificate-event race: Ledger code, its test and internal/core are unchanged, and the scenario does not configure Connectivity or pull secrets. This is not a proven root cause or a green CI result; no blind retry was performed.

No deployment or live registry pull qualification. Envtest does not run Kubernetes garbage collection or the Connectivity workload controller.

Merge Danger

Door: two-way, with credential cleanup requiring care.

Blast Radius: stacks.

Install the updated ResourceReference CRD with the controller: older schemas prune targetName. Source Secrets need an authorized formance.com/stack label and a unique matching logical name. Existing unmanaged local Secrets retain their rotation lifecycle. Removing the final reference owner can garbage-collect a copy; source authorization removal alone does not revoke existing copies. Overlapping Policies retain Connectivity's priority/name precedence. Install the Policy CRD and generated RBAC before configuring the plugin Setting; restart Operator if that optional API becomes available after startup.

Leave this PR and the sandbox MR open in draft for David's review. No merge, release or deployment is authorized.

Comment thread internal/resources/stacks/init.go Resolved
@NumaryBot NumaryBot added risk: high bot-reviewed draft-reviewed NumaryBot reviewed this draft, but published no readiness signal. labels Oct 27, 2026
@Dav-14 Dav-14 changed the title feat(connectivity): copy pull secrets and manage independent policies feat(connectivity): copy pull secrets and manage shared plugin policy Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-reviewed draft-reviewed NumaryBot reviewed this draft, but published no readiness signal. risk: high

Development

Successfully merging this pull request may close these issues.

2 participants