Skip to content

Docs: provide text for 'oc explain' on operator CRDs#357

Merged
esnible merged 2 commits into
mainfrom
improve-oc-explain
May 13, 2026
Merged

Docs: provide text for 'oc explain' on operator CRDs#357
esnible merged 2 commits into
mainfrom
improve-oc-explain

Conversation

@esnible

@esnible esnible commented May 13, 2026

Copy link
Copy Markdown
Member

Summary

Kubernetes and OpenShift admins use oc explain to understand CRDs.

The previous output for our CRDs was based on generated Go code and very confusing:

oc explain agentcard
...
DESCRIPTION:
     AgentCard is the Schema for the agentcards API.
...

This PR gives a real description for each of our CRDs.

(Optional) Testing Instructions

make manifests
kubectl apply -f config/crd/bases/agent.kagenti.dev_agentcards.yaml 
kubectl apply -f config/crd/bases/agent.kagenti.dev_agentruntimes.yaml
oc explain agentcard
oc explain agentruntimes

With this change, the output should include

DESCRIPTION:
     AgentCard binds an A2A agent card to a backing workload. The controller
     periodically fetches the card from the referenced workload, verifies its
     JWS signature and SPIFFE identity against the configured trust domain, and
     caches the result in status.

and

DESCRIPTION:
     AgentRuntime attaches runtime configuration to a backing workload
     classified as an agent or tool, providing per-workload overrides for SPIFFE
     identity and OpenTelemetry tracing. The controller reports pod
     configuration coverage and phase in status.

Note: Running make manifest, overrides The namespaceSelector, objectSelector, and timeoutSeconds: 10 that were deliberately added manually to config/webhook/manifests.yaml in commits 19918ea and b89651f . If we plan to continue allowing make manifest to work, we should probably also make the changes to authbridge_webhook.go:214.

Signed-off-by: Ed Snible <snible@us.ibm.com>
Signed-off-by: Ed Snible <snible@us.ibm.com>

@huang195 huang195 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Swaps the boilerplate "X is the Schema for the X API" kubebuilder descriptions for real, user-facing ones on AgentCard and AgentRuntime; the regenerated CRD YAMLs pick up the same text. Claims check out against the controllers — JWS signature + SPIFFE trust-domain verification on the AgentCard side, phase + per-workload SPIRE/OTel overrides on the AgentRuntime side.

Areas reviewed: Go API types, CRD YAML
Commits: 2, both signed-off (the second restores the manual webhook-manifests override that make manifests clobbered in the first)
CI status: all green

Follow-up (not blocking)

PR body correctly calls out that make manifests overwrites the manual namespaceSelector / objectSelector / timeoutSeconds in config/webhook/manifests.yaml (restored here via afe62a9) and suggests baking those into authbridge_webhook.go:214. Worth a tracking issue so the next person running make manifests doesn't silently re-regress the webhook config — happy to file one after this merges if it's not already tracked.

@esnible
esnible merged commit e8882b4 into main May 13, 2026
15 checks passed
@esnible
esnible deleted the improve-oc-explain branch May 13, 2026 20:46
huang195 added a commit to huang195/kagenti-operator that referenced this pull request May 14, 2026
Restore manual webhook manifest overrides clobbered by `make manifests`,
add a deprecated annotation fallback in the mode resolution chain, and
clean up minor code-review nits.

Per-comment changes:

rossoctl#1 (must-fix): Restore namespaceSelector / objectSelector / timeoutSeconds
on the inject.kagenti.io webhook in config/webhook/manifests.yaml. PR rossoctl#357
manually re-added these fields after `make manifests` clobbered them; the
prior commit on this branch wiped them again. Without them the webhook
fires on every pod admission cluster-wide which, combined with the new
proxy-sidecar default, is a much wider blast radius than today.

rossoctl#3 (suggestion): Re-introduce AnnotationAuthBridgeMode as a deprecated
fourth layer of the mode resolution chain (between the namespace
ConfigMap and the cluster-wide proxy-sidecar fallback). Workloads that
still set kagenti.io/authbridge-mode get the same mode they had before
this PR, with a `DEPRECATED:` log line per pod admission to push them
toward AgentRuntime.Spec.AuthBridgeMode.

rossoctl#4 (suggestion): Add a TODO on InjectionDecision.SpiffeHelper marking it
for rename to SpireEnabled in a follow-up PR.

rossoctl#5 (suggestion): Replace the `evaluateSidecar("spiffe-helper", true,
...)` magic-true call with a dedicated `evaluateSpiffeHelper(label)`
helper, mirroring the previous evaluateClientRegistration pattern.

rossoctl#6 (nit): Update the proxy-sidecar test error message that still
referenced the old "authbridge-light" image name.

Comment rossoctl#2 (spiffe-helper bundling readiness) is a coordination concern
between this PR and kagenti-extensions PR rossoctl#409. The combined Dockerfiles
on rossoctl#409's branch (76d2cb3) DO bundle spiffe-helper and the
entrypoint-proxy.sh / entrypoint-envoy.sh DO conditionally start it on
SPIRE_ENABLED — so end-state is correct as long as rossoctl#409 lands first.
No code change here; merge ordering is the answer.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants