Description
Some paginated list commands validate --page-size but do not validate --page.
Steps to Reproduce
- Run command:
harbor artifact list --page 0
harbor project list --page -1
harbor registry list --page 0
- Observe that the command does not fail early with a clear validation error.
Expected Behavior
Commands that support pagination should reject invalid page values before making API calls.
Actual Behavior
Some commands validate --page-size but not --page, so invalid page values are accepted and passed to the API.
Environment
- OS: any
- Tool version: current main branch
- Other relevant details: none
Additional Context
Reference implementation:
cmd/harbor/root/project/logs.go
Target files:
cmd/harbor/root/artifact/list.go
cmd/harbor/root/project/list.go
cmd/harbor/root/registry/list.go
This is a follow-up to the validation added for --page-size in #631.
Description
Some paginated list commands validate
--page-sizebut do not validate--page.Steps to Reproduce
harbor artifact list --page 0harbor project list --page -1harbor registry list --page 0Expected Behavior
Commands that support pagination should reject invalid page values before making API calls.
Actual Behavior
Some commands validate
--page-sizebut not--page, so invalid page values are accepted and passed to the API.Environment
Additional Context
Reference implementation:
cmd/harbor/root/project/logs.goTarget files:
cmd/harbor/root/artifact/list.gocmd/harbor/root/project/list.gocmd/harbor/root/registry/list.goThis is a follow-up to the validation added for
--page-sizein #631.