configfile
On this page
Description
The command line client supports configuring by a given configuration file.
If existent, by default, the file $HOME/.ocmconfig
will be read.
Using the option –config
an alternative file can be specified.
The file format is yaml. It uses the same type mechanism used for all
kinds of typed specification in the ocm area. The file must have the type of
a configuration specification. Instead, the command line client supports
a generic configuration specification able to host a list of arbitrary configuration
specifications. The type for this spec is generic.config.ocm.software/v1
.
The following configuration types are supported:
attributes.config.ocm.software
The config typeattributes.config.ocm.software
can be used to define a list of arbitrary attribute specifications:type: attributes.config.ocm.software attributes: <name>: <yaml defining the attribute> ...
cli.ocm.config.ocm.software
The config typecli.ocm.config.ocm.software
is used to handle the main configuration flags of the OCM command line tool.type: cli.ocm.config.ocm.software aliases: <name>: <OCI registry specification> ...
credentials.config.ocm.software
The config typecredentials.config.ocm.software
can be used to define a list of arbitrary configuration specifications:type: credentials.config.ocm.software consumers: - identity: <name>: <value> ... credentials: - <credential specification> ... credential chain repositories: - repository: <repository specification> credentials: - <credential specification> ... credential chain aliases: <name>: repository: <repository specification> credentials: - <credential specification> ... credential chain
downloader.ocm.config.ocm.software
The config typedownloader.ocm.config.ocm.software
can be used to define a list of preconfigured download handler registrations (see ocm ocm-downloadhandlers), the default priority is 200:type: downloader.ocm.config.ocm.software description: "my standard download handler configuration" registrations: - name: oci/artifact artifactType: ociImage mimeType: ... description: ... priority: ... config: ... ...
generic.config.ocm.software
The config typegeneric.config.ocm.software
can be used to define a list of arbitrary configuration specifications and named configuration sets:type: generic.config.ocm.software configurations: - type: <any config type> ... ... sets: standard: description: my selectable standard config configurations: - type: ... ... ...
Configurations are directly applied. Configuration sets are just stored in the configuration context and can be applied on-demand. On the CLI, this can be done using the main command option
–config-set <name>
.hasher.config.ocm.software
The config typehasher.config.ocm.software
can be used to define the default hash algorithm used to calculate digests for resources. It supports the fieldhashAlgorithm
, with one of the following values:NO-DIGEST
SHA-256
(default)SHA-512
keys.config.ocm.software
The config typekeys.config.ocm.software
can be used to define public and private keys. A key value might be given by one of the fields:path
: path of file with key datadata
: base64 encoded binary datastringdata
: data a string parsed by key handler
type: keys.config.ocm.software privateKeys: <name>: path: <file path> ... publicKeys: <name>: data: <base64 encoded key representation> ... rootCertificates: - path: <file path> issuers: <name>: commonName: acme.org
Issuers define an expected distinguished name for public key certificates optionally provided together with signatures. They support the following fields:
commonName
stringorganization
string arrayorganizationalUnit
string arraycountry
string arraylocality
string arrayprovince
string arraystreetAddress
string arraypostalCode
string array
At least the given values must be present in the certificate to be accepted for a successful signature validation.
logging.config.ocm.software
The config typelogging.config.ocm.software
can be used to configure the logging aspect of a dedicated context type:type: logging.config.ocm.software contextType: attributes.context.ocm.software settings: defaultLevel: Info rules: - ...
The context type attributes.context.ocm.software is the root context of a context hierarchy.
If no context type is specified, the config will be applies to any target acting as logging context provider, which is not a non-root context.
memory.credentials.config.ocm.software
The config typememory.credentials.config.ocm.software
can be used to define a list of arbitrary credentials stored in a memory based credentials repository:type: memory.credentials.config.ocm.software repoName: default credentials: - credentialsName: ref reference: # refer to a credential set stored in some other credential repository type: Credentials # this is a repo providing just one explicit credential set properties: username: mandelsoft password: specialsecret - credentialsName: direct credentials: # direct credential specification username: mandelsoft2 password: specialsecret2
merge.config.ocm.software
The config typemerge.config.ocm.software
can be used to set some assignments for the merging of (label) values. It applies to a value merge handler registry, either directly or via an OCM context.type: merge.config.ocm.software labels: - name: acme.org/audit/level merge: algorithm: acme.org/audit config: ... assignments: label:acme.org/audit/level@v1: algorithm: acme.org/audit config: ... ...
oci.config.ocm.software
The config typeoci.config.ocm.software
can be used to define OCI registry aliases:type: oci.config.ocm.software aliases: <name>: <OCI registry specification> ...
ocm.cmd.config.ocm.software
The config typeocm.cmd.config.ocm.software
can be used to configure predefined aliases for dedicated OCM repositories and OCI registries.type: ocm.cmd.config.ocm.software ocmRepositories: <name>: <specification of OCM repository> ... ociRepositories: <name>: <specification of OCI registry> ...
ocm.config.ocm.software
The config typeocm.config.ocm.software
can be used to set some configurations for an OCM context;type: ocm.config.ocm.software aliases: myrepo: type: <any repository type> <specification attributes> ... resolvers: - repository: type: <any repository type> <specification attributes> ... prefix: ghcr.io/open-component-model/ocm priority: 10
With aliases repository alias names can be mapped to a repository specification. The alias name can be used in a string notation for an OCM repository.
Resolvers define a list of OCM repository specifications to be used to resolve dedicated component versions. These settings are used to compose a standard component version resolver provided for an OCM context. Optionally, a component name prefix can be given. It limits the usage of the repository to resolve only components with the given name prefix (always complete name segments). An optional priority can be used to influence the lookup order. Larger value means higher priority (default 10).
All matching entries are tried to lookup a component version in the following order:
- highest priority first
- longest matching sequence of component name segments first.
If resolvers are defined, it is possible to use component version names on the command line without a repository. The names are resolved with the specified resolution rule. They are also used as default lookup repositories to lookup component references for recursive operations on component versions (
–lookup
option).plugin.config.ocm.software
The config typeplugin.config.ocm.software
can be used to configure a plugin.type: plugin.config.ocm.software plugin: <plugin name> config: <arbitrary configuration structure> disableAutoRegistration: <boolean flag to disable auto registration for up- and download handlers>
rootcerts.config.ocm.software
The config typerootcerts.config.ocm.software
can be used to define general root certificates. A certificate value might be given by one of the fields:path
: path of file with key datadata
: base64 encoded binary datastringdata
: data a string parsed by key handler
rootCertificates: - path: <file path>
scripts.ocm.config.ocm.software
The config typescripts.ocm.config.ocm.software
can be used to define transfer scripts:type: scripts.ocm.config.ocm.software scripts: <name>: path: <>file path> <other name>: script: <>nested script as yaml>
transport.ocm.config.ocm.software
The config typetransport.ocm.config.ocm.software
can be used to define transfer scripts:type: transport.ocm.config.ocm.software recursive: true overwrite: true localResourcesByValue: false resourcesByValue: true sourcesByValue: false keepGlobalAccess: false stopOnExistingVersion: false omitAccessTypes: - s3
uploader.ocm.config.ocm.software
The config typeuploader.ocm.config.ocm.software
can be used to define a list of preconfigured upload handler registrations (see ocm ocm-uploadhandlers), the default priority is 200:type: uploader.ocm.config.ocm.software description: "my standard upload handler configuration" registrations: - name: oci/artifact artifactType: ociImage config: ociRef: ghcr.io/open-component-model/... ...