list componentversions
On this page
Usage
ocm list componentversions [<options>] {<component-reference>}Options
-c, --constraints constraints version constraint
-h, --help help for componentversions
--latest restrict component versions to latest
--lookup stringArray repository name or spec for closure lookup fallback
-o, --output string output mode (JSON, json, yaml)
--repo string repository name or spec
-S, --scheme string schema version
-s, --sort stringArray sort fieldsDescription
List lists the version names of the specified objects, if only a component is specified all versions according to the given version constraints are listed.
If the option –constraints is given, and no version is specified
for a component, only versions matching the given version constraints
(semver https://github.com/Masterminds/semver) are selected.
With –latest only
the latest matching versions will be selected.
If the –repo option is specified, the given names are interpreted
relative to the specified repository using the syntax
<component>[:<version>]
If no –repo option is specified the given names are interpreted
as located OCM component version references:
[<repo type>::]<host>[:<port>][/<base path>]//<component>[:<version>]
Additionally there is a variant to denote common transport archives and general repository specifications
[<repo type>::]<filepath>|<spec json>[//<component>[:<version>]]
The –repo option takes an OCM repository specification:
[<repo type>::]<configured name>|<file path>|<spec json>
For the Common Transport Format the types directory,
tar or tgz is possible.
Using the JSON variant any repository types supported by the linked library can be used:
OCI Repository types (using standard component repository to OCI mapping):
CommonTransportFormat: v1OCIRegistry: v1oci: v1ociRegistry
If a component lookup for building a reference closure is required
the –lookup option can be used to specify a fallback
lookup repository. By default, the component versions are searched in
the repository holding the component version for which the closure is
determined. For Component Archives this is never possible, because
it only contains a single component version. Therefore, in this scenario
this option must always be specified to be able to follow component
references.
If the option –scheme is given, the component descriptor
is converted to the specified format for output. If no format is given
the storage format of the actual descriptor is used or, for new ones v2
is used.
With internal the internal representation is shown.
The following schema versions are supported for explicit conversions:
ocm.software/v3alpha1v2
With the option –output the output mode can be selected.
The following modes are supported:
(default)JSONjsonyaml
Examples
$ ocm list componentversion ghcr.io/open-component-model/ocm//ocm.software/ocmcli
$ ocm list componentversion --repo OCIRegistry::ghcr.io/open-component-model/ocm ocm.software/ocmcliSee Also
- ocm list — List information about components