Skip to content

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

Draft
kriscoleman wants to merge 2 commits intomainfrom
fix/enterprise-portal-status-json-body
Draft

fix(cli): send JSON struct for enterprise portal status update#714
kriscoleman wants to merge 2 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

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.

1 participant