feat(zli): add config list/show/get/set/reset and isolate deprecated syntax (#4037)

* feat(zli): add config list/show/get/set/reset and isolate deprecated syntax

Introduce first-class subcommands for listing profiles, showing a profile,
getting and setting keys, and resetting optional keys (alongside existing add/remove).
The parent command now resolves ~/.zot via zliUserConfigPath(),
documents that profile names must not clash with subcommand names,
and states that positional/--list/--reset usage is deprecated and will be removed soon.

Legacy behavior is delegated to config_cmd_deprecated.go with stderr warnings for old flags and positional get/set.
Examples and inline help point users at the new commands.
FormatNames/FormatListedVars comments reference config list/show.

Tests are split so config_cmd_test.go exercises the supported subcommands
while config_cmd_deprecated_test.go retains coverage for the deprecated
paths under renamed TestConfigCmdDeprecated* entries.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

* test: stabilize retention check tests

See https://github.com/project-zot/zot/actions/runs/25361779632/job/74362802944?pr=4037

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

---------

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
This commit is contained in:
Andrei Aaron
2026-05-08 20:19:26 +03:00
committed by GitHub
parent b89d10834c
commit c7ddbe2e36
7 changed files with 1108 additions and 267 deletions
+1
View File
@@ -87,6 +87,7 @@ var (
ErrScanNotSupported = errors.New("scanning is not supported for given media type")
ErrCLITimeout = errors.New("query timed out while waiting for results")
ErrDuplicateConfigName = errors.New("cli config name already added")
ErrReservedConfigName = errors.New("cli config name is reserved")
ErrInvalidRoute = errors.New("invalid route prefix")
ErrImgStoreNotFound = errors.New("image store not found corresponding to given route")
ErrLocalImgStoreNotFound = errors.New("local image store not found corresponding to given route")