-
Notifications
You must be signed in to change notification settings - Fork 156
Description
Summary
The validateCompositeToolRefs function in virtualmcpserver_controller.go does not call statusManager.SetObservedGeneration() in any of its code paths, unlike all other validation functions in the VirtualMCPServer controller.
Context
All other validation functions in the VirtualMCPServer controller consistently set ObservedGeneration in all code paths:
| Function | Sets ObservedGeneration? |
|---|---|
discoverBackends |
✅ Yes (both paths) |
validateGroupRef |
✅ Yes (all 3 paths) |
validateCompositeToolRefs |
❌ No (none of 4 paths) |
validateAndUpdatePodTemplateStatus |
✅ Yes (both paths) |
validateAndUpdateIncomingAuthStatus |
✅ Yes (both paths) |
applyStatusDecision |
✅ Yes |
validateCompositeToolRefs is the only validation function that doesn't set ObservedGeneration in any of its exit paths:
- Empty refs (success) - line 307-312
- Not found error - line 323-332
- Invalid status error - line 339-352
- All refs valid (success) - line 363-368
Impact
Without setting ObservedGeneration, it's harder for users to determine whether the controller has processed the current resource spec version when debugging reconciliation issues related to composite tool references.
Recommended Fix
Add statusManager.SetObservedGeneration(vmcp.Generation) to all 4 exit paths in validateCompositeToolRefs to match the pattern used by other validation functions.
Related
Identified during PR review of #2944.