Skip to content

feat(operator): credential automation — Secret transit, OpenShell providers, degrade-loud rotation (#265) - #270

Merged
dzungtr merged 2 commits into
mainfrom
pi-subagents/worker-Implement-GitHub-issue-https-github.com-dzungtr-kape-issues-265-final-slice-of-e-43c1ae3e-00ee06b-fd0a-s0-t0
Oct 19, 2026
Merged

dzungtr merged 2 commits into
mainfrom
pi-subagents/worker-Implement-GitHub-issue-https-github.com-dzungtr-kape-issues-265-final-slice-of-e-43c1ae3e-00ee06b-fd0a-s0-t0

Conversation

@dzungtr

@dzungtr dzungtr commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Closes #265

Final slice of epic #261. The operator turns a KapeAgentServer's credentials[] registry into OpenShell provider records and hands the controller an env table naming only the providers the gateway actually holds. Rotation is a Secret edit; a broken credential is loud about itself and nothing else.

What changed

Secret resolver (M4) — operator/infra/k8s/secret_resolver.go

  • Resolve(ctx, namespace, refs) (ResolvedSecrets, failures) — same-namespace reads only, gated on the Secret label kape.io/credential=true; key/value material lives in memory and nothing else (never logged, never persisted, never placed on the CR).
  • Failure reasons are stable and named: SecretNotFound, SecretNotLabeled, SecretNoData, SecretReadFailed, CrossNamespaceSecretRef. Messages name the credential and the Secret — never a value.
  • RBAC narrowed in the chart: the operator's ClusterRole now grants Secrets get, list, watch only (it previously had full verbs on Secrets; nothing else in the operator writes Secrets).

Renderer credentials section (M2) — operator/domain/agentserver

  • Provider/profile naming consumes handoff H2 verbatim: kape-<crNamespace>-<crName>-<credName>.
  • KAPE_CREDENTIAL_BINDINGS consumes handoff H1 verbatim — [{"provider": "<name>", "hosts": ["host:port", …]}] — and carries only credentials present in the resolved-and-pushed set, in CR order (so it is deterministic and never binds an endpoint to a provider that is not there).
  • Ships the git-https provider-profile document as operator code (domain/agentserver/profiles.go), pinned by a golden test (testdata/git-https.profile.yaml) so the H5 debugging document cannot drift from what the operator imports.
  • Posture for feat(controller): env-fed credential bindings merged into sandbox policy (#264) #269 finding 3: the imported documents are endpointless. The credential boundary is the CR's hostPatterns, carried in KAPE_CREDENTIAL_BINDINGS and merged into the sandbox policy by the controller; a profile-declared endpoint would collide with the controller-emitted credential_binding endpoint (network endpoint ambiguity). H5 below shows both the operator-imported form and the endpoint-declaring twin for manual debugging.

OpenShell writer (M3) — operator/infra/openshell

  • Ordering: LintProviderProfiles (only documents that are not on the gateway yet) → ImportProviderProfiles → CreateProvider/UpdateProvider.
  • Profiles are imported platform-scoped (no workspace_scope), so providers in any workspace resolve them without profile_workspace — verified live.
  • Idempotent: an existing profile is neither re-imported nor re-linted, and unchanged credential values perform no write (see the readback finding below).
  • Rotation = UpdateProvider with the new value. RotateProviderCredential is unusable for operator-pushed credentials on this gateway — it refreshes gateway-owned material only and answers NotFound: provider refresh state not found (recorded live). Not called.
  • Conflicts/transient unavailability retry with bounded exponential backoff (Aborted|ResourceExhausted|Unavailable, 3 attempts, 100 ms → 200 ms).
  • Per-credential failures ride outcomes; the error return is reserved for "gateway unreachable" so the reconcile retries without rolling back the healthy part of the profile.

Watches + status

  • MapSecretToAgentServers + CredentialSecretPredicate: a labelled Secret edit/delete in a namespace requeues every KapeAgentServer there that references it (rotation = edit the Secret). Unlabelled Secrets never enter the cache.
  • status.credentials[] — Pushed per entry (reason + message), plus FailClosedEnforced=False/GatewayEnforcementUnavailable on live entries: the H6 gap surfaced as a per-credential condition, not a full-policy replace.
  • Aggregate Degraded — True naming every failed entry (credentials not pushed: github (SecretNotFound)), False/CredentialsCurrent otherwise, False/NoCredentials for an empty registry.

Module wiring (handoff H3) and chart

  • The operator imports the v0.1.0 client generated in the controller module (github.com/dzungtr/kape/controller/gen), exactly as H3 states ("each Go slice that needs gateway types imports this package"). Consequences: operator/go.mod gains require + local replace, go.work includes ./controller, the operator image copies the controller module, and the operator's k8s libraries unify on v0.34.2 (from v0.32.0) — the renderer golden files were regenerated for that serializer's creationTimestamp behaviour.
  • Chart: operator.openshell.* (gateway addr defaults to controllerWiring.gatewayAddr, its own mTLS Secret mount, workspace). The writer is disabled unless operator.openshell.credsSecret is set; without it every credential reports Pushed=False/GatewayNotConfigured rather than staying silently unprovisioned.
  • Fixed while here: operator/Dockerfile ran go build ./cmd/..., which matches two packages (cmd, cmd/playground) and failed with cannot write multiple packages to non-directory. Now ./cmd, CGO_ENABLED=0; the image builds (verified locally with podman).

Handoff H5 — git-https provider-profile document

The document the operator actually imports (endpointless), generated from the shipped registry (operator/domain/agentserver/testdata/git-https.profile.yaml, pinned by TestGitHTTPSProfileDocument):

id: git-https
display_name: Git over HTTPS (GitHub)
description: GitHub git and REST API over HTTPS with proxy-layer auth-header injection
category: source_control
credentials:
  - name: token
    description: GitHub token injected at the egress proxy
    required: true
    auth_style: bearer
    header_name: Authorization
binaries:
  - path: /usr/bin/git
  - path: /usr/bin/gh

Manual debugging twin — same document with endpoints, for openshell profile import + provider create when you want a provider that carries its own boundary (this is the #269 proof shape; do not wire it into the controller path, the endpoints collide):

id: git-https-debug
display_name: Git over HTTPS (GitHub, self-bounded)
description: GitHub git and REST API over HTTPS with proxy-layer auth-header injection
category: source_control
credentials:
  - name: token
    description: GitHub token injected at the egress proxy
    required: true
    auth_style: bearer
    header_name: Authorization
endpoints:
  - host: github.com
    port: 443
    protocol: rest
    rules:
      - allow: {method: "*", path: "**"}
  - host: api.github.com
    port: 443
    protocol: rest
    rules:
      - allow: {method: "*", path: "**"}
binaries:
  - path: /usr/bin/git
  - path: /usr/bin/gh

Debugging notes (live-verified, v0.1.0):

  • Import is not idempotent: a second import answers custom provider profile '<id>' already exists. LintProviderProfiles reports the same for an already-registered profile, so lint is only meaningful for documents not yet on the gateway.
  • A workspace-scoped profile needs Provider.profile_workspace set to that workspace; platform-scoped profiles (the operator's choice) need nothing.
  • Credential values are write-only: GetProvider returns the key with an opaque placeholder. The operator therefore detects value drift against the fingerprint of what it last pushed (in memory only); an operator restart re-pushes every credential — safe, and it converges on the Secret's truth.
  • RotateProviderCredential requires gateway-owned refresh material (provider refresh configure); for operator-pushed credentials it answers NotFound: provider refresh state not found.
  • In the sandbox the credential name appears as a resolver placeholder (openshell:resolve:env:<id>_token); the proxy substitutes the real value at egress — no real credential material is in the sandbox.
  • The legacy openrouter/openrouter-spike providers still reference the retired generic profile, so create_agent remains down until their providers are recreated from a real profile. Out of scope here; noted so the next smoke does not chase it.

Verification

Gate commands (local — CI has no runners, so this output is the gate):

$ cd operator && GOWORK=off CGO_ENABLED=0 go build ./...          # BUILD OK
$ GOWORK=off CGO_ENABLED=0 go vet ./...                            # VET OK
$ GOWORK=off CGO_ENABLED=0 go vet -tags envtest ./test/integration/ # VET OK
$ GOWORK=off CGO_ENABLED=0 go test -count=1 ./...                  # see below
ok  .../cmd            0.009s
ok  .../controller     0.009s
ok  .../domain/agentserver 0.004s
ok  .../domain/config  0.003s
ok  .../infra/k8s      0.018s
ok  .../infra/openshell 0.004s
ok  .../infra/toml     0.008s
FAIL .../controller/reconcile  4 × TestToolReconciler_*   (loopback denied)
FAIL .../infra/qdrant          4 × TestEnsureCollection/DeleteCollection (loopback denied)
$ CGO_ENABLED=0 go build ./operator/cmd/...                        # workspace (go.work) build OK
$ bash charts/kape/tests/render-test.sh                            # OK: all chart render assertions passed
$ helm lint charts/kape                                            # 1 chart(s) linted, 0 chart(s) failed
$ podman build -f operator/Dockerfile .                            # image builds

The 8 failures are pre-existing and unrelated: verified identical on a clean worktree at 518f645 (same 8 names, connect: permission denied on 127.0.0.1 httptest servers — this sandbox denies loopback).

New tests (all pass):

Contract Test
resolver: labelled same-namespace read, label gating (incl. ="false"), same-namespace only, missing/empty/nameless ref, no refs infra/k8s/secret_resolver_test.go (7)
renderer: H1 bindings shape, pushed-only filtering, H2 naming, profile dedupe/order, unknown provider type, purity, H5 golden document, registry copy-safety, required credential keys domain/agentserver/render_test.go (+7, golden TestGitHTTPSProfileDocument)
writer: lint→import→create ordering, idempotent re-apply, drift → update, conflict retry + backoff durations, one rejected credential only, unknown type, missing key, lint failure, unreachable gateway, existing profile not re-imported/not re-linted, no values in messages, empty records, fingerprint infra/openshell/writer_test.go (13)
reconcile: push + env + per-credential + H6 + Degraded, broken credential degrades alone, unlabelled Secret, cross-namespace refusal, writer failure requeues while Deployment converges, no gateway configured, no credentials, values never on CR/Deployment, Secret edit re-pushes controller/reconcile/agentserver_credentials_test.go (9)
watch: Secret → referencing CRs (same namespace only), unlabelled Secret ignored, wrong object type, predicate controller/watches_test.go (+4)
envtest (CI-only): missing Secret → Degraded=True naming the entry, labelled Secret → pushed + bindings env, Secret edit → rotation reaches the writer test/integration/agentserver_envtest_test.go::TestAgentServerReconcileCredentialsEnvtest

Fix round 1 — chart→operator env-var spelling (P0, commit b0ef603)

The chart set KAPE_OPERATOR_OPENSHHELL_* (double H) while ff/v3.4.0 derives KAPE_OPERATOR_OPENSHELL_*, so operator.openshell.credsSecret never enabled the credential writer — the feature's only declarative path was dead, and render-test.sh asserted the same misspelling. Fixed the three chart vars, the three render-test assertions and two Go message strings. New operator/cmd/env_binding_test.go derives the expected env names from the flag definitions (newFlagSet) and asserts every chart KAPE_OPERATOR_* var resolves to a real flag, that every flag binds to its derived env name, and that the openshell trio reaches config. Binary-level proof: KAPE_OPERATOR_OPENSHELL_GATEWAY_ADDR=openshell-k265-probe.invalid:8080 → OpenShell credential writer configured {"gateway": "openshell-k265-probe.invalid:8080"}; the double-H spelling → writer stays disabled. grep -rn OPENSHHELL → 0.

Acceptance criteria

# Criterion Status
1 Labelled Secret + credentials[] entry materializes an OpenShell provider, the controller env updates, fresh sandbox passes #264's verification with no manual provider setup Partially verified (live + fix round 1): the declarative enablement path (operator.openshell.credsSecret → KAPE_OPERATOR_OPENSHELL_* → credential writer) is now proven — see Fix round 1; it was silently dead before the spelling fix. Provider materialization, profile import, CR conditions and KAPE_CREDENTIAL_BINDINGS proven live: provider materializes, profile imported, CR conditions + KAPE_CREDENTIAL_BINDINGS correct — proven with the operator binary against microk8s. The "fresh sandbox passes without manual provider setup" leg is environment-blocked (needs a published kape-controller image; the live controller is ArgoCD-managed from the homelab repo — same blocker #262/#264 recorded)
2 Editing the Secret rotates the provider credential; new sandboxes use the new value Partially verified (live): Secret edit → watch → reconcile → provider updated (resource version 2→3) with Degraded=False; the "new sandboxes use it" leg is environment-blocked with #1
3 Deleting/breaking the Secret sets the credential condition + Degraded=True naming the entry; other credentials and sandbox creation keep working Verified (live) for conditions/Degraded/binding filtering: Degraded=True … github (SecretNotFound), github-backup still Pushed=True, bindings env carries only the healthy provider, the controller Deployment still converges. Sandbox creation itself is environment-blocked with #1
4 Cross-namespace secretRef rejected at schema/reconcile level Verified (live + unit): admission rejects (secretRef must be same-namespace: omit namespace); the reconciler refuses it before any read (CrossNamespaceSecretRef)
5 Tests: resolver envtest, writer fake-gateway, renderer golden with credentials Verified (unit + golden run locally); the envtest case is authored and CI-only (envtest cannot start in this sandbox — loopback denied)
6 H5 recorded Verified: H5 above (also to be pasted into #261's Handoffs table)

Extra live checks: label gating end to end (unlabelled Secret → SecretNotLabeled, labelling recovers → all 2 credentials pushed) and AC "no secret values in kubectl logs"-equivalent — the operator's stdout contains zero token matches (grep -cE 'ghp_|gho_|ghs_|github_pat_' → 0).

Live run (operator binary vs microk8s, gateway v0.1.0)

kubectl port-forward svc/openshell 32353:8080 -n openshell, operator run locally with --openshell-gateway-addr=127.0.0.1:32353 --openshell-creds-dir=~/.config/openshell/gateways/k8s/mtls, CR k265-slice/k265 with two git-https credentials on a labelled Secret:

$ openshell provider list
NAME                                 TYPE       CREDENTIAL_KEYS  CONFIG_KEYS
openrouter                           generic    1                0
openrouter-spike                     generic    1                0
kape-k265-slice-k265-github          git-https  1                0
kape-k265-slice-k265-github-backup   git-https  1                0

$ openshell profile list --type provider
git-https  provider  SOURCE CONTROL  user  platform

$ kubectl get kas k265 -o jsonpath='{.status.conditions}'
Degraded=False CredentialsCurrent: all 2 credentials pushed to the OpenShell gateway
  github:        Pushed=True  | FailClosedEnforced=False GatewayEnforcementUnavailable
  github-backup: Pushed=True  | FailClosedEnforced=False GatewayEnforcementUnavailable

$ kubectl get deploy kape-controller-k265 -o jsonpath='…env[?(@.name=="KAPE_CREDENTIAL_BINDINGS")].value'
[{"provider":"kape-k265-slice-k265-github","hosts":["github.com:443","api.github.com:443"]},
 {"provider":"kape-k265-slice-k265-github-backup","hosts":["github.com:443"]}]

# rotation: patch the Secret
$ openshell provider get kape-k265-slice-k265-github     Resource version: 2
$ kubectl patch secret k265-github-token -p '{"stringData":{"token":"…"}}'
$ openshell provider get kape-k265-slice-k265-github     Resource version: 3

# break it: delete the Secret, then recreate it unlabelled
$ kubectl delete secret k265-github-token
Degraded=True  CredentialsDegraded: credentials not pushed: github (SecretNotFound)
  github: Pushed=False SecretNotFound   github-backup: Pushed=True
KAPE_CREDENTIAL_BINDINGS=[{"provider":"kape-k265-slice-k265-github-backup","hosts":["github.com:443"]}]
$ kubectl create secret generic k265-github-token …        # no label yet
credentials not pushed: github (SecretNotLabeled)
$ kubectl label secret k265-github-token kape.io/credential=true
all 2 credentials pushed to the OpenShell gateway           # bindings restored

# cross-namespace secretRef
$ kubectl apply --dry-run=server -f k265-crossns.yaml
The KapeAgentServer "k265-crossns" is invalid: spec.credentials[0]: Invalid value:
secretRef must be same-namespace: omit namespace (credential Secrets are read from the KapeAgentServer namespace only)

Live finding that changed the implementation: the first run reported Pushed=False/ProfileLintFailed: custom provider profile 'git-https' already exists — LintProviderProfiles treats an already-registered profile as an error diagnostic. The writer now checks existence first and lints only new documents (pinned by TestWriter_ApplyReusesImportedProfile, and the fake gateway mirrors the gateway's behaviour).

Environment-blocked / not done

  • Fresh-sandbox end-to-end (criteria 1/2, sandbox legs): needs a published ghcr.io/dzungtr/kape-controller image and a CR-managed controller Deployment. The live controller is ArgoCD-managed from the homelab repo (no registry credentials, no GitOps write path from here) — recorded by Proto re-pin to OpenShell v0.1.0 + workspace_scope fix (cluster upgrade done) #262/Credential-injection mechanism proof: controller binding merge + profile-backed manual provider #264 too. Left unfaked.
  • CI: GitHub Actions still has no registered runners, so the envtest case never executes there either; it is authored and type-checked (go vet -tags envtest).
  • RotateProviderCredential: recorded as unavailable for operator-pushed credentials (evidence above) rather than worked around.
  • Provider pruning: a credential removed from a CR leaves its provider record on the gateway (it is no longer in KAPE_CREDENTIAL_BINDINGS, so nothing binds it). Cleanup of orphaned kape-* providers is a follow-up, deliberately out of this slice.
  • In-cluster writer enablement is chart-gated on operator.openshell.credsSecret; the shipped default is off, because a missing mTLS Secret would otherwise crash-loop the operator.

Cluster left as found: namespace k265-slice, all k265-* providers/profiles and the port-forward removed; the four legacy CRDs installed only to start the operator locally were deleted again; openrouter / openrouter-spike untouched; kapeagentservers.kape.io untouched.

…viders, degrade-loud rotation

Closes #265 (final slice of epic #261). The operator now turns a
KapeAgentServer's credentials[] registry into OpenShell provider records and
hands the controller an env table that names only providers the gateway
actually holds.

Secret resolver (M4, operator/infra/k8s/secret_resolver.go)
- Same-namespace reads only, gated on kape.io/credential=true; values stay in
  memory and never reach the CR, the env contract, or a log line.
- Missing, unlabelled, empty, or unreadable Secrets are per-credential failures
  naming the entry — never a silent skip.

Renderer credentials section (M2, operator/domain/agentserver)
- Provider names follow handoff H2 (kape-<ns>-<cr>-<cred>); the git-https
  provider-profile document ships as operator code (endpointless: the CR's
  hostPatterns are the credential boundary, #269 finding 3).
- KAPE_CREDENTIAL_BINDINGS carries [{provider, hosts[]}] (handoff H1) for
  pushed credentials only, in CR order.

OpenShell writer (M3, operator/infra/openshell)
- Lint → import → create/update per provider type, platform-scoped profiles so
  every workspace resolves them without profile_workspace.
- Idempotent: an existing profile is neither re-imported nor re-linted (the
  gateway answers both with "already exists" — verified live), and unchanged
  credential values perform no write. Rotation is UpdateProvider with the new
  value; RotateProviderCredential only refreshes gateway-owned material and
  answers NotFound "provider refresh state not found" for pushed credentials.
- Conflicts and transient unavailability retry with exponential backoff; a
  rejected credential fails alone.

Watches and status
- Labelled Secret edits requeue every KapeAgentServer in the namespace that
  references them (rotation = edit the Secret).
- status.credentials[] carries Pushed per entry plus the H6 fail-closed gap;
  the aggregate Degraded condition names the entries that failed while the
  healthy rest of the profile keeps serving.

Module wiring: the operator imports the v0.1.0 client generated into the
controller module (handoff H3), so operator/go.mod gains a require + local
replace, go.work includes ./controller, and the image build copies the module.
The operator's k8s libraries unify on v0.34.2 as a result; the golden files
were regenerated for that serializer.

Chart: the operator Deployment gets its own mTLS gateway connection
(operator.openshell.*, disabled unless a creds Secret is set) and the ClusterRole
grants Secrets get/list/watch only.

Also fixes the operator image build: `go build ./cmd/...` matched two packages.
…dential writer can be enabled

The operator deployment rendered KAPE_OPERATOR_OPENSHHELL_* (double H) while
ff derives env names from the flag names (--openshell-gateway-addr →
KAPE_OPERATOR_OPENSHELL_GATEWAY_ADDR), so setting
operator.openshell.credsSecret never enabled the credential writer. The
render-test asserted the same misspelling, locking the bug in.

- rename the three chart env vars to the single-H spelling and fix the two
  user-facing Go messages that named the same var
- fix the three render-test assertions
- hoist flag registration/parsing in operator/cmd into newFlagSet/parseConfig so
  a new test can derive env names from the flag definitions: every chart
  KAPE_OPERATOR_* var must resolve to a real flag, every flag must bind to its
  derived env name, and the openshell trio must land in config
@dzungtr

dzungtr commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

Fix round 1 — chart→operator env-var spelling (P0)

Commit b0ef603. The chart shipped KAPE_OPERATOR_OPENSHHELL_* (double H); ff/v3.4.0 derives env names as UPPER(flag) with -→_ (parse.go:31,291), so the real names are KAPE_OPERATOR_OPENSHELL_*. Consequence: operator.openshell.credsSecret never enabled the credential writer, i.e. the feature's only declarative path was dead. The render-test asserted the same misspelling, so it stayed green.

What changed

File Change
charts/kape/templates/operator/deployment.yaml three env vars → KAPE_OPERATOR_OPENSHELL_{GATEWAY_ADDR,CREDS_DIR,WORKSPACE}
charts/kape/tests/render-test.sh three assertions → single-H
operator/cmd/main.go two user-facing messages → single-H; flag registration + ff parse hoisted into newFlagSet/parseConfig
operator/controller/reconcile/agentserver.go GatewayNotConfigured message → single-H
operator/cmd/env_binding_test.go (new) regression pin, below

Every chart-set KAPE_OPERATOR_* var was enumerated and cross-checked against operator/cmd/main.go: all 8 controller vars + the 3 openshell vars now match a real flag (the other 5 flags — metrics-bind-address, health-probe-bind-address, leader-elect, max-concurrent-reconciles, kape-config-* — are not chart-set).

Regression pin — expectation derived from the flag definitions

operator/cmd/env_binding_test.go (no hand-written env names):

  • TestEveryFlagBindsToDerivedEnvName — for every registered flag, sets the derived env name to a value differing from the flag default and asserts the parsed value changed. Proves the derivation mirror against ff itself.
  • TestOpenShellEnvVarsReachConfig — the three openshell names land in config.OpenShellGatewayAddr/CredsDir/Workspace.
  • TestChartOperatorEnvVarsMatchFlags — parses the chart template, asserts every KAPE_OPERATOR_* var it sets resolves to a derived flag env name, and that the openshell trio is still rendered.

Mutation check (chart reverted to double-H, test run with -count=1):

--- FAIL: TestChartOperatorEnvVarsMatchFlags
    env_binding_test.go:121: chart sets KAPE_OPERATOR_OPENSHHELL_GATEWAY_ADDR, which matches no operator flag (ff would ignore it)
    ... CREDS_DIR, WORKSPACE likewise
    env_binding_test.go:127: chart does not set KAPE_OPERATOR_OPENSHELL_GATEWAY_ADDR (flag --openshell-gateway-addr); the credential writer stays disabled
FAIL	github.com/kape-io/kape/operator/cmd	0.007s

Binding proof — real binary, not just the string

Operator binary built from this branch, run with --leader-elect=false, KAPE_OPERATOR_METRICS_BIND_ADDRESS=0, KAPE_OPERATOR_HEALTH_PROBE_BIND_ADDRESS=0 (loopback bind is sandbox-denied), a stub kubeconfig and a freshly minted mTLS creds dir:

== A: single-H env (correct) ==
INFO main OpenShell credential writer configured {"gateway": "openshell-k265-probe.invalid:8080", "workspace": "k265-probe-ws"}
== B: no env (writer off) ==
INFO main OpenShell credential writer disabled: set KAPE_OPERATOR_OPENSHELL_GATEWAY_ADDR to enable it
== C: double-H env (old typo) ==
INFO main OpenShell credential writer disabled: set KAPE_OPERATOR_OPENSHELL_GATEWAY_ADDR to enable it

A enables the writer and reads the value; C is ignored by ff, which is exactly the bug.

Render + gates

$ helm template t charts/kape --set operator.openshell.credsSecret=openshell-client-tls | sed -n '260,266p'
            - name: KAPE_OPERATOR_OPENSHELL_GATEWAY_ADDR
              value: "openshell.openshell.svc.cluster.local:8080"
            - name: KAPE_OPERATOR_OPENSHELL_CREDS_DIR
              value: "/var/run/kape-operator/openshell-mtls"
            - name: KAPE_OPERATOR_OPENSHELL_WORKSPACE
              value: "default"

$ helm template t charts/kape | grep -c KAPE_OPERATOR_OPENSHELL   # default render
0

$ bash charts/kape/tests/render-test.sh
OK: all chart render assertions passed

$ cd operator && CGO_ENABLED=0 go build ./...   # BUILD OK
$ CGO_ENABLED=0 go vet ./...                    # VET OK
$ CGO_ENABLED=0 go test -count=1 ./cmd/... ./controller/ ./domain/... ./infra/openshell/ ./infra/k8s/
ok  .../operator/cmd          0.008s
ok  .../operator/controller   0.007s
ok  .../operator/domain/agentserver 0.003s
ok  .../operator/domain/config      0.003s
ok  .../operator/infra/openshell    0.003s
ok  .../operator/infra/k8s          0.014s

$ grep -rn OPENSHHELL . --exclude-dir=.git --exclude-dir=node_modules | wc -l
0

Pre-existing sandbox-only failures, untouched by this commit: infra/qdrant and the httptest-backed cases in controller/reconcile fail with dial tcp 127.0.0.1:<port>: connect: permission denied (nono blocks loopback listeners).

@dzungtr
dzungtr merged commit e7285ca into main Oct 19, 2026
1 check failed
@dzungtr
dzungtr deleted the pi-subagents/worker-Implement-GitHub-issue-https-github.com-dzungtr-kape-issues-265-final-slice-of-e-43c1ae3e-00ee06b-fd0a-s0-t0 branch October 19, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operator credential automation: registry → OpenShell providers → env, rotation, degrade-loud

1 participant