Add OCI layer selector to API docs

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2022-08-24 12:46:04 +03:00
parent 49dc30922d
commit e5cb32b0f2
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
4 changed files with 30 additions and 3 deletions

View File

@ -138,7 +138,8 @@ type OCIRepositoryRef struct {
// OCILayerSelector specifies which layer should be extracted from an OCI Artifact // OCILayerSelector specifies which layer should be extracted from an OCI Artifact
type OCILayerSelector struct { type OCILayerSelector struct {
// MediaType specifies the OCI media type of the layer // MediaType specifies the OCI media type of the layer
// which should be extracted from the OCI Artifact. // which should be extracted from the OCI Artifact. The
// first layer matching this type is selected.
// +optional // +optional
MediaType string `json:"mediaType,omitempty"` MediaType string `json:"mediaType,omitempty"`
} }

View File

@ -82,7 +82,8 @@ spec:
properties: properties:
mediaType: mediaType:
description: MediaType specifies the OCI media type of the layer description: MediaType specifies the OCI media type of the layer
which should be extracted from the OCI Artifact. which should be extracted from the OCI Artifact. The first layer
matching this type is selected.
type: string type: string
type: object type: object
provider: provider:

View File

@ -2571,7 +2571,8 @@ string
<td> <td>
<em>(Optional)</em> <em>(Optional)</em>
<p>MediaType specifies the OCI media type of the layer <p>MediaType specifies the OCI media type of the layer
which should be extracted from the OCI Artifact.</p> which should be extracted from the OCI Artifact. The
first layer matching this type is selected.</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -368,6 +368,30 @@ spec:
This field takes precedence over all other fields. This field takes precedence over all other fields.
### Layer selector
`spec.layerSelector` is an optional field to specify which layer should be extracted from the OCI Artifact.
If not specified, the controller will extract the first layer found in the artifact.
To extract a layer matching a specific
[OCI media type](https://github.com/opencontainers/image-spec/blob/v1.0.2/media-types.md):
```yaml
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: <repository-name>
spec:
layerSelector:
mediaType: "application/deployment.content.v1.tar+gzip"
```
If the layer selector matches more than one layer, the first layer matching the specified media type will be used.
Note that the selected OCI layer must be
[compressed](https://github.com/opencontainers/image-spec/blob/v1.0.2/layer.md#gzip-media-types)
in the `tar+gzip` format.
### Ignore ### Ignore
`.spec.ignore` is an optional field to specify rules in [the `.gitignore` `.spec.ignore` is an optional field to specify rules in [the `.gitignore`