Skip to content

fix(cli): send JSON struct for enterprise portal status update#714

Merged
kriscoleman merged 3 commits intomainfrom
fix/enterprise-portal-status-json-body
May 7, 2026
Merged

fix(cli): send JSON struct for enterprise portal status update#714
kriscoleman merged 3 commits intomainfrom
fix/enterprise-portal-status-json-body

Conversation

@kriscoleman
Copy link
Copy Markdown
Member

@kriscoleman kriscoleman commented May 4, 2026

Shortcut Story

sc-136041

Summary

Fixes the replicated enterprise-portal status update command so that it sends a proper JSON object ({\"status\":\"...\"}) instead of a bare JSON string, which was causing the API to return a 400 error.

Also updates the CLI help text to enumerate the valid statuses (active, inactive, pending) instead of the vague "any other valid status" wording.

Changes

  • Updated UpdateEnterprisePortalStatus in pkg/kotsclient/enterprise-portal.go to construct and send an UpdateEnterprisePortalStatusRequest struct.
  • Added UpdateEnterprisePortalStatusRequest struct with a status JSON field.
  • Added pkg/kotsclient/enterprise-portal_test.go with unit tests covering all enterprise portal client methods.
  • Updated --help text and --status flag description in cli/cmd/enterpriseportal_status_update.go to list valid statuses.

UAT

  1. Run the new unit tests: go test ./pkg/kotsclient/... -run TestEnterprisePortalClient -v
  2. Verify the CLI builds: go build ./cli/...
  3. Verify the updated help text: go run ./cli enterprise-portal status update --help
  4. (Optional) Run replicated enterprise-portal status update --status inactive against a valid app and confirm it succeeds without a 400 error.

@kriscoleman
Copy link
Copy Markdown
Member Author

Question: why doesn't the enterprise-portal command show under replicated help?

image

@kriscoleman
Copy link
Copy Markdown
Member Author

before (first command) and after (second command):
image

@kriscoleman kriscoleman marked this pull request as ready for review May 7, 2026 18:09
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8640e65. Configure here.

Comment thread pkg/kotsclient/enterprise-portal_test.go
@kriscoleman kriscoleman merged commit 7e47225 into main May 7, 2026
6 checks passed
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.

3 participants