Skip to content

Add omitempty to MCPGroupStatus JSON fields#5181

Open
sharanrajt wants to merge 1 commit intostacklok:mainfrom
sharanrajt:fix/correct-CRD-type
Open

Add omitempty to MCPGroupStatus JSON fields#5181
sharanrajt wants to merge 1 commit intostacklok:mainfrom
sharanrajt:fix/correct-CRD-type

Conversation

@sharanrajt
Copy link
Copy Markdown

Fixes #4537

Summary

  • Add omitempty to servers and serverCount JSON tags in MCPGroupStatus so optional fields are omitted from serialized output when empty, consistent with other optional fields in the struct.

Fixes #

Type of change

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

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

Add omitempty to servers and serverCount JSON tags in
MCPGroupStatus so optional fields are omitted from serialized
output when empty, consistent with other optional fields in
the struct.

Fixes stacklok#4537

Signed-off-by: Sharan Raj T <sharanrajtm@gmail.com>
Copy link
Copy Markdown
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch is trivial and doesn't change the wire format.

@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label May 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.54%. Comparing base (9057f7a) to head (553921b).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5181      +/-   ##
==========================================
- Coverage   67.58%   67.54%   -0.05%     
==========================================
  Files         602      602              
  Lines       61119    61119              
==========================================
- Hits        41308    41280      -28     
- Misses      16690    16718      +28     
  Partials     3121     3121              

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

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.

Add omitempty to MCPGroupStatus Servers and ServerCount JSON tags

2 participants