Skip to content

Feat: add MTLSReady condition to AgentRuntime status#461

Merged
pdettori merged 1 commit into
rossoctl:mainfrom
varshaprasad96:feat/mtls-ready-condition
Jun 23, 2026
Merged

Feat: add MTLSReady condition to AgentRuntime status#461
pdettori merged 1 commit into
rossoctl:mainfrom
varshaprasad96:feat/mtls-ready-condition

Conversation

@varshaprasad96

Copy link
Copy Markdown
Contributor

Summary

  • Add MTLSReady condition logic to the AgentRuntime reconciler (T006 from mTLS spec)
  • Controller evaluates SPIRE availability on each reconcile by checking for spire-agent-socket or svid-output volumes in the workload's pod template
  • Emits Warning Event with actionable guidance when SPIRE is missing but mTLS is enabled

Condition States

Reason Status When
SPIREAvailable True SPIRE volumes detected in workload pod template
SPIREUnavailable False mTLS mode is permissive/strict but no SPIRE volumes found
MTLSDisabled True mTLSMode explicitly set to disabled
SPIREAssumed True Sandbox workloads (webhook handles injection at pod CREATE)

Key Design Decisions

  • MTLSReady=False does NOT block Ready=True — it's informational for fleet-wide mTLS rollout tracking
  • SPIRE detection checks pod template volumes, not running pod state — this is the right layer since the webhook injects volumes at admission time
  • Sandbox workloads assume SPIRE is available since typed PodSpec is not accessible from unstructured objects

Test plan

  • All unit tests pass (make test)
  • Deploy agent with SPIRE → verify MTLSReady=True/SPIREAvailable
  • Deploy agent without SPIRE → verify MTLSReady=False/SPIREUnavailable + Warning Event
  • Deploy agent with mTLSMode: disabled → verify MTLSReady=True/MTLSDisabled

Jira: RHAIENG-4928
Spec: specs/003-mtls-transport-security (PR #401)

🤖 Generated with Claude Code

@varshaprasad96
varshaprasad96 requested a review from a team as a code owner June 22, 2026 19:39
Implement T006 from the mTLS transport security spec. The controller
now evaluates SPIRE availability on each reconcile and sets the
MTLSReady condition on AgentRuntime status:

- SPIREAvailable (True): spire-agent-socket or svid-output volumes
  detected in the workload's pod template
- SPIREUnavailable (False): mTLS mode is permissive/strict but no
  SPIRE volumes found; emits a Warning Event with actionable guidance
- MTLSDisabled (True): mTLSMode explicitly set to disabled
- SPIREAssumed (True): Sandbox workloads where PodSpec is not
  available; SPIRE injection handled by webhook at pod CREATE

MTLSReady=False does NOT block Ready=True — it is informational so
operators can track mTLS rollout progress across the fleet.

Jira: RHAIENG-4928

Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
@varshaprasad96
varshaprasad96 force-pushed the feat/mtls-ready-condition branch from b8aa171 to d3cb30e Compare June 22, 2026 19:46

@pdettori pdettori 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.

Clean implementation of the informational MTLSReady condition (T006). Code follows existing controller patterns consistently — accessor, condition API, event emission with nil-check guard.

Verified:

  • MTLSReady=False does NOT block Ready=True
  • Sandbox path returns SPIREAssumed via nil-podSpec check (not nil-function-pointer) ✓
  • RBAC diff is controller-gen consolidation — no permission change (serviceaccounts and services already had identical verbs) ✓
  • Warning Event emits actionable guidance ✓
  • All 16 CI checks passing ✓

@pdettori
pdettori merged commit f8c06b9 into rossoctl:main Jun 23, 2026
16 checks passed
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.

2 participants