docker inspect: add support for swarm configs

The docker inspect command did not inspect configs. This patch adds support for
it, and while at it, also sorts the list of objects in runInspect.

Before this patch:

    docker config create myconfig ./codecov.yml
    danpeyh8qzb30vgdj9fr665l1

    docker inspect --format='{{.ID}}' myconfig
    []
    Error: No such object: myconfig

    docker inspect --format='{{.ID}}' --type=config myconfig
    "config" is not a valid value for --type

With this patch:

    docker inspect --format='{{.ID}}' myconfig
    danpeyh8qzb30vgdj9fr665l1

    docker inspect --format='{{.ID}}' --type=config myconfig
    danpeyh8qzb30vgdj9fr665l1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-10-24 18:28:35 +02:00
parent 61baf2a3d9
commit e9ae9f788b
2 changed files with 13 additions and 2 deletions

View File

@ -29,7 +29,7 @@ all the details of the format.
### <a name="type"></a> Specify target type (--type)
`--type container|image|node|network|secret|service|volume|task|plugin`
`--type config|container|image|node|network|secret|service|volume|task|plugin`
The `docker inspect` command matches any type of object by either ID or name. In
some cases multiple type of objects (for example, a container and a volume)