Description
The non-interactive webhook commands (harbor webhook create and harbor webhook edit) validate the --endpoint-url directly without normalizing it first. This is inconsistent with other Harbor CLI commands that normalize URLs using FormatUrl(...) before validation.
Steps to Reproduce
- Run command:
harbor webhook create --endpoint-url example.com/webhook
- Or:
harbor webhook edit --endpoint-url example.com/webhook
- Observe that the command may reject the URL due to a missing scheme (
http:// or https://)
Expected Behavior
The CLI should normalize the input URL before validation.
Example:
example.com/webhook → https://example.com/webhook
After normalization, the URL should pass validation.
Actual Behavior
The CLI validates the raw input directly.
As a result, URLs without a scheme (such as example.com/webhook) may fail validation, even though similar inputs are accepted in other commands.
Environment
- OS: Not specified
- Tool version: latest
- Other relevant details: N/A
Additional Context
Other Harbor CLI commands (e.g., registry update) normalize URLs using FormatUrl(...) before validation. The webhook commands should follow the same pattern for consistency.
Description
The non-interactive webhook commands (
harbor webhook createandharbor webhook edit) validate the--endpoint-urldirectly without normalizing it first. This is inconsistent with other Harbor CLI commands that normalize URLs usingFormatUrl(...)before validation.Steps to Reproduce
harbor webhook create --endpoint-url example.com/webhook
harbor webhook edit --endpoint-url example.com/webhook
http://orhttps://)Expected Behavior
The CLI should normalize the input URL before validation.
Example:
example.com/webhook → https://example.com/webhook
After normalization, the URL should pass validation.
Actual Behavior
The CLI validates the raw input directly.
As a result, URLs without a scheme (such as
example.com/webhook) may fail validation, even though similar inputs are accepted in other commands.Environment
Additional Context
Other Harbor CLI commands (e.g., registry update) normalize URLs using
FormatUrl(...)before validation. The webhook commands should follow the same pattern for consistency.