Skip to content

Conversation

@bennyyang11
Copy link
Contributor

Summary

Fixes the customer archive command which was ignoring the --app flag and always returning "Error: no app specified".

Problem

The customer archive command defined its own local --app flag that shadowed the global --app flag. This prevented the parent command from properly initializing the app context.

Before:
$ replicated customer archive --app myapp customer_123
Error: no app specified
After:
$ replicated customer archive --app myapp customer_123
Customer archived successfully

Solution

  • Removed the local --app flag definition
  • Updated code to use r.appID from the runner context (which is set by the global flag)
  • Added comment explaining the design decision

Changes

  • 1 file modified: cli/cmd/customer_archive.go
  • Removed local app variable and flag
  • Updated archiveCustomer() function signature
  • Changed GetCustomerByName(app, ...) to GetCustomerByName(r.appID, ...)

Testing

Manual testing verified:

  • Created test customer
  • Archived with --app flag (previously failed, now works)
  • Verified customer removed from active list
  • Verified customer still accessible via inspect

Build & Tests:

  • Build passes
  • No linter errors
  • All tests pass
  • No regressions in other customer commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants