Input and Access Types
On this page
Overview
The Open Component Model spec supports multiple methods how to add resources to a component version. There are two different ways to add content: Input Type and Access Type.
An Input type adds content by value, along with the component descriptor and stores it in the same target repository where the component is stored. After pushing the content to the target registry this always resolves to the attribute
in a component descriptor.
An Access Type just adds content by reference to an external location, e.g., an OCI registry. It is a kind of pointer in a component descriptor. It resolves to the attribute
in a component descriptor.
The following input types are supported:
- binary
- dir
- docker
- dockermulti
- file
- helm
- ociImage
- spiff
- utf-8
Please use the latest ocm-cli to check available input types:
The following list of access types is supported:
- gitHub
- localBlob
- ociArtifact
- ociBlob
- s3
Please use the latest ocm-cli to check available access types:
Not all access and input types can be combined in useful ways with all artifact types. But the OCM specification does not define any restrictions on possible combinations.
The following sections give an overview and typical usage examples for access and input types. It does not describe the full list of possible fields and their meaning. For a complete list of attributes, please see the command reference. The examples below are meant to be used in a component that looks like this:
Input Types
binary
Allows to define resources with binary content being base64 encoded. Should only be used for smaller blobs.
dir
Defines a resource from content of a directory in the local file system. It is packed with tar
and optionally compressed.
docker
Takes an image from the local docker registry and adds it as a resource. Requires a running docker daemon.
if VERSION is set to 0.1.0 the following image is imported:
The target location of the image can be set with the repository
field. Here the resulting image will be stored at <REPO_URL>/github.com/open-component-model/megacomponent/images/mega:1.10
.
dockermulti
Takes multiple images from the local docker registry and adds them as single multi-arch image. Requires a running docker daemon. The images have to be built for different architectures/os and need a unique tag identifying them. As docker does not support multi-arch images at the time of writing this is a workaround.
if VERSION is set to 0.1.0 the following image is imported:
The target location of the image can be set with the repository
field. Here the resulting image will be stored at <REPO_URL>/github.com/open-component-model/megacomponent/images/megamulti:1.10
.
file
Imports a file from the local file system and adds it as a resource.
helm
Imports a helm chart from the local file system and adds it as a resource.
After transporting the corresponding component version to an OCI registry, the helm chart will be made available under charts/mega
prefixed by the name of the component version. This auto-prefix can be disabled by using a leading slash /charts/mega
. If the repository
tag is omitted, the name of the helm chart from Chart.yaml
will be used.
It is also possible to import a helm chart from a helm chart repository:
Here the helm chart version 12.2.7
is copied from the path mariadb
in helm chart repository https://charts.bitnami.com/bitnami
. After transporting the corresponding component version to an OCI registry, the helm chart will be made available under charts/mariadb
prefixed by the name of the component version. This auto-prefix can be disabled by using a leading slash /charts/mariadb
. If the repository
tag is omitted, the name of the helm chart from Chart.yaml
will be used. There are additional optional fields caCert
and caCertFile
to specify a TLS certificate for the helm chart repository.
ociImage
Takes an image that is located in an OCI registry and adds it as a resource.
The target location of the image after transporting to an OCI registry can be set with the repository
field. Here the resulting image will be prefixed with the name of the component version, e.g., github.com/open-component-model/megacomponent/images/echo:1.10
. This auto-prefix can be disabled by using a leading slash /images/echo
.
spiff
Processes a resource using the spiff templater and can provide values for variables.
utf-8
Adds a resource from inline text.
Access Types
gitHub
Refers to a Git repository at a certain commit or tag.
helm
Refers to a helm chart located in a helm chart repository.
npm
Refers to an npm package located in a Javascript package registry.
ociArtifact
Refers to an image in an (external) OCI registry.
s3
Refers to an object in an AWS S3 store.