Skip to content

[bug]: replication log rejects advertised positional execution and task IDs #939

@rambhardwajj

Description

@rambhardwajj

Description

The replication log command advertises support for positional EXECUTION_ID and TASK_ID arguments, but the command currently rejects them due to incorrect Cobra argument validation.

This change updates the command to properly accept and validate up to two positional arguments, matching the documented CLI behavior.

Steps to Reproduce

  1. Run command: harbor replication log 123 456
  2. Observe error: Error: accepts at most 0 arg(s), received

Expected Behavior

The command should accept positional EXECUTION_ID and TASK_ID arguments as documented.

Actual Behavior

Cobra argument validation rejects positional arguments before the command execution flow runs.

Environment

  • OS: macOS / Darwin arm64
  • Tool version: Harbor CLI current main branch
  • Go version: go1.26.2 darwin/arm64

Additional Context

The command usage and generated docs currently advertise:
harbor replication log [EXECUTION_ID] [TASK_ID]. However, the command was configured with: Args: cobra.MaximumNArgs(0) which prevents positional arguments from being used at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions