Skip to content

Support lookup by channel name or ID for channel delete command#717

Merged
sgalsaleh merged 1 commit intomainfrom
salah/sc-136973/replicated-channel-delete-requires-channel
May 5, 2026
Merged

Support lookup by channel name or ID for channel delete command#717
sgalsaleh merged 1 commit intomainfrom
salah/sc-136973/replicated-channel-delete-requires-channel

Conversation

@sgalsaleh
Copy link
Copy Markdown
Member

Summary

Updates replicated channel delete (and its alias rm) to accept either a channel name or a channel ID, matching the behavior of other channel commands such as inspect and release demote.

Problem

Previously, replicated channel delete <name> failed with archive app channel: Not found. because the command passed the raw argument directly to the archive API as an ID, with no name resolution.

Solution

Uses the existing GetChannelByName helper (already used by channel inspect) to resolve the input to a channel before calling ArchiveChannel. This provides:

  • Lookup by exact channel ID (fast path)
  • Fallback to name matching against the app's channel list
  • Built-in ambiguous-match and not-found error handling

Changes

  • cli/cmd/channel_rm.go:
    • Updated usage string: rm CHANNEL_ID_OR_NAME
    • Updated missing-arg error: channel name or ID is required
    • Added GetChannelByName resolution before ArchiveChannel

@sgalsaleh sgalsaleh merged commit d58f0e8 into main May 5, 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.

2 participants