Skip to content

Add AuthServerConfig validation condition to VirtualMCPServer reconciler#4350

Merged
jhrozek merged 3 commits intomainfrom
vmcp-add-as-scaffolding-4
Mar 25, 2026
Merged

Add AuthServerConfig validation condition to VirtualMCPServer reconciler#4350
jhrozek merged 3 commits intomainfrom
vmcp-add-as-scaffolding-4

Conversation

@jhrozek
Copy link
Copy Markdown
Contributor

@jhrozek jhrozek commented Mar 24, 2026

Summary

  • When a VirtualMCPServer has an inline AuthServerConfig, the operator should validate it during reconciliation and surface the result as a status condition.
  • Add AuthServerConfigValidated condition to the VirtualMCPServer reconciler that is set when inline AuthServerConfig is present on the spec.
  • Add SetAuthServerConfigValidatedCondition to the status collector interface.
  • Add E2E test for the condition lifecycle.

Fixes: #4143

Type of change

  • New feature

Test plan

  • Unit tests (task test)
  • Linting (task lint-fix)
  • E2E tests (new virtualmcp_authserver_config_test.go)

Special notes for reviewers

Draft — stacked on #4349. Review the incremental diff only.

Generated with Claude Code

@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Mar 24, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 10.00000% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.58%. Comparing base (a9f92a0) to head (27eb54a).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...perator/controllers/virtualmcpserver_controller.go 5.26% 35 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4350      +/-   ##
==========================================
+ Coverage   69.55%   69.58%   +0.02%     
==========================================
  Files         480      480              
  Lines       48837    48978     +141     
==========================================
+ Hits        33971    34080     +109     
- Misses      12249    12274      +25     
- Partials     2617     2624       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tgrunnagle
tgrunnagle previously approved these changes Mar 24, 2026
@jhrozek jhrozek force-pushed the vmcp-add-as-scaffolding-3 branch from d447384 to 39a9a1e Compare March 24, 2026 21:14
Base automatically changed from vmcp-add-as-scaffolding-3 to main March 25, 2026 15:16
@jhrozek jhrozek dismissed tgrunnagle’s stale review March 25, 2026 15:16

The base branch was changed.

jhrozek and others added 2 commits March 25, 2026 15:49
- Add RuntimeConfig and AuthServerConfig wrapper types to config model
  (runtime-only, not part of CRD schema)
- Set AuthServerConfigValidated condition in reconciler when inline
  AuthServerConfig is present on the spec
- Add E2E test for AuthServerConfigValidated condition lifecycle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…on lifecycle

Move AuthServerConfig validation from Validate() into a dedicated
reconciler method that sets AuthServerConfigValidated condition on both
success (True) and failure (False), matching the pattern used by
validateGroupRef. This wires up the previously unused
ConditionReasonAuthServerConfigInvalid constant and clears stale
conditions when AuthServerConfig is removed from the spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jhrozek jhrozek force-pushed the vmcp-add-as-scaffolding-4 branch from 244236f to e8a7a1b Compare March 25, 2026 15:50
@jhrozek jhrozek marked this pull request as ready for review March 25, 2026 15:50
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 25, 2026
tgrunnagle
tgrunnagle previously approved these changes Mar 25, 2026
The validateAuthServerConfig method on *VirtualMCPServer was only called
from tests — the real validation with condition lifecycle lives in the
reconciler. Remove the duplicate method and its test. Also drop the
unused receiver name on the reconciler method to fix the revive lint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 25, 2026
@jhrozek jhrozek merged commit a4dc39f into main Mar 25, 2026
42 checks passed
@jhrozek jhrozek deleted the vmcp-add-as-scaffolding-4 branch March 25, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 4: Operator reconciler, HTTP handler unit tests, and E2E test coverage for embedded AS

2 participants