Skip to content

fix(operator): detect vMCP volume drift - #6299

Open
jstar0 wants to merge 1 commit into
stacklok:mainfrom
jstar0:fix/5619-vmcp-volume-drift
Open

fix(operator): detect vMCP volume drift#6299
jstar0 wants to merge 1 commit into
stacklok:mainfrom
jstar0:fix/5619-vmcp-volume-drift

Conversation

@jstar0

@jstar0 jstar0 commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Changes to Secrets, ConfigMaps, and CA bundles referenced by a vMCP deployment can change the generated pod volumes without changing the existing pod-template hash. The operator therefore leaves a stale deployment running.

This change hashes the complete generated volume and volume-mount state used by the pod template and compares that hash during reconciliation. It also removes the annotation when the desired state no longer contains a volume hash.

Fixes #5619

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (go test ./cmd/thv-operator/controllers -count=1)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (reviewed generated volume state and annotation cleanup paths)

API Compatibility

  • This PR does not break the v1beta1 API.

Changes

File Change
virtualmcpserver_controller.go Compare generated volume hash and prune stale hash annotations.
virtualmcpserver_deployment.go Hash generated volumes and mounts from the same builder output used by the pod template.
controller tests Cover volume drift detection and annotation cleanup.

Does this introduce a user-facing change?

No. The operator now rolls deployments when referenced volume inputs change.

Special notes for reviewers

The focused controller package tests pass on the rebased branch.

Hash the complete generated volume and volume-mount state so changes to referenced Secrets, ConfigMaps, and CA bundles roll the Deployment.

Signed-off-by: King Star <mcxin.y@gmail.com>
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.

vMCP drift detection never compares volumes/volumeMounts, so auth-server (and CA-bundle) secret changes don't redeploy

1 participant