Skip to content

Fixed VirtualMCPCompositeToolDefinition printer columns output#5380

Merged
ChrisJBurns merged 4 commits into
stacklok:mainfrom
Sanskarzz:printcolumnfix3
May 28, 2026
Merged

Fixed VirtualMCPCompositeToolDefinition printer columns output#5380
ChrisJBurns merged 4 commits into
stacklok:mainfrom
Sanskarzz:printcolumnfix3

Conversation

@Sanskarzz
Copy link
Copy Markdown
Contributor

@Sanskarzz Sanskarzz commented May 25, 2026

Summary

  • Removes the malformed Steps and Refs printer columns from VirtualMCPCompositeToolDefinition.
  • Avoids adding display-only status fields or a new reconciler just to maintain printer column counts.
  • Regenerates the CRD manifests and API documentation so kubectl get virtualmcpcompositetooldefinitions no longer renders broken integer columns.

Fixes #4619

Type of change

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

Test plan

  • Generated artifacts (task operator-generate, task operator-manifests, task crdref-gen)
  • Targeted compile tests (go test ./cmd/thv-operator/api/v1alpha1 ./cmd/thv-operator/api/v1beta1 ./cmd/thv-operator/app -run '^$' -count=1)
  • Lint (task lint)

API Compatibility

  • This PR does not break the v1beta1 API, OR the api-break-allowed label is applied, and the migration guidance is described above.

Changes

File Change
cmd/thv-operator/api/v1beta1/virtualmcpcompositetooldefinition_types.go Removes the broken Steps and Refs printer column markers.
cmd/thv-operator/api/v1alpha1/types.go Removes the same deprecated-version printer column markers.
Generated CRD/docs output Removes the malformed additional printer columns from published manifests and documentation.

Does this introduce a user-facing change?

Yes. kubectl get virtualmcpcompositetooldefinitions no longer shows the broken Steps and Refs columns. The remaining columns continue to render normally.

Special notes for reviewers

Kubernetes CRD printer column JSONPath cannot compute array lengths. A count-based implementation would require scalar status fields plus reconciliation logic to keep them current. Per review feedback, this PR uses the lower-risk fix and removes the malformed display columns instead.

@github-actions github-actions Bot added the size/M Medium PR: 300-599 lines changed label May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.79%. Comparing base (8932f93) to head (672e093).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5380      +/-   ##
==========================================
- Coverage   68.81%   68.79%   -0.02%     
==========================================
  Files         628      628              
  Lines       63900    63900              
==========================================
- Hits        43971    43962       -9     
- Misses      16669    16683      +14     
+ Partials     3260     3255       -5     

☔ 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.

@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 26, 2026
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 26, 2026
@ChrisJBurns
Copy link
Copy Markdown
Collaborator

@Sanskarzz Looking at this, do we need another controller just for a printer column? It seems a bit overkill?

@Sanskarzz
Copy link
Copy Markdown
Contributor Author

@ChrisJBurns The reason I added the small reconciler is that the Kubernetes printer column JSONPath cannot compute array lengths. The existing .spec.steps[*] / .status.referencingVirtualServers[*] paths expand array contents, so to display integer counts reliably, we need scalar fields such as status.stepCount and status.refCount.

Because VirtualMCPCompositeToolDefinition did not already have a controller maintaining its status, this reconciler is what keeps those fields accurate when the definition changes or when VirtualMCPServers add/remove compositeToolRefs.

That said, I agree it is more machinery than ideal for a display-only issue, but the approach was recommended in the issue description. If you prefer the lower-scope fix, I can simplify this PR to remove the broken Steps/Refs columns instead of maintaining count fields.

@ChrisJBurns
Copy link
Copy Markdown
Collaborator

@Sanskarzz Yeah I think removing them is probably better for us. I thought the change would have been possible without another Reconciler, but if not, I'm happy for you to remove the malformed columns instead

Sanskarzz added 4 commits May 29, 2026 01:59
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 28, 2026
@Sanskarzz
Copy link
Copy Markdown
Contributor Author

Sounds good, thanks. I’ve removed the malformed Steps and Refs printer columns instead of adding status count fields and a reconciler. Also updated PR description.

@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels May 28, 2026
@ChrisJBurns
Copy link
Copy Markdown
Collaborator

Thanks @Sanskarzz , I'll get @jerm-dro to take a look at this internally as vMCP is his wheelhouse, hopefully we should be good to go.

@ChrisJBurns ChrisJBurns merged commit 374d452 into stacklok:main May 28, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VirtualMCPCompositeToolDefinition printer columns show broken output

2 participants