File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,8 @@ type OCIRepositoryRef struct {
138138// OCILayerSelector specifies which layer should be extracted from an OCI Artifact
139139type OCILayerSelector struct {
140140 // MediaType specifies the OCI media type of the layer
141- // which should be extracted from the OCI Artifact.
141+ // which should be extracted from the OCI Artifact. The
142+ // first layer matching this type is selected.
142143 // +optional
143144 MediaType string `json:"mediaType,omitempty"`
144145}
Original file line number Diff line number Diff line change 8282 properties :
8383 mediaType :
8484 description : MediaType specifies the OCI media type of the layer
85- which should be extracted from the OCI Artifact.
85+ which should be extracted from the OCI Artifact. The first layer
86+ matching this type is selected.
8687 type : string
8788 type : object
8889 provider :
Original file line number Diff line number Diff line change @@ -2571,7 +2571,8 @@ string
25712571<td >
25722572<em >(Optional)</em >
25732573<p >MediaType specifies the OCI media type of the layer
2574- which should be extracted from the OCI Artifact.</p >
2574+ which should be extracted from the OCI Artifact. The
2575+ first layer matching this type is selected.</p >
25752576</td >
25762577</tr >
25772578</tbody >
Original file line number Diff line number Diff line change @@ -368,6 +368,30 @@ spec:
368368
369369This field takes precedence over all other fields.
370370
371+ # ## Layer selector
372+
373+ ` spec.layerSelector` is an optional field to specify which layer should be extracted from the OCI Artifact.
374+ If not specified, the controller will extract the first layer found in the artifact.
375+
376+ To extract a layer matching a specific
377+ [OCI media type](https://github.com/opencontainers/image-spec/blob/v1.0.2/media-types.md) :
378+
379+ ` ` ` yaml
380+ ---
381+ apiVersion: source.toolkit.fluxcd.io/v1beta2
382+ kind: OCIRepository
383+ metadata:
384+ name: <repository-name>
385+ spec:
386+ layerSelector:
387+ mediaType: "application/deployment.content.v1.tar+gzip"
388+ ` ` `
389+
390+ If the layer selector matches more than one layer, the first layer matching the specified media type will be used.
391+ Note that the selected OCI layer must be
392+ [compressed](https://github.com/opencontainers/image-spec/blob/v1.0.2/layer.md#gzip-media-types)
393+ in the `tar+gzip` format.
394+
371395# ## Ignore
372396
373397` .spec.ignore` is an optional field to specify rules in [the `.gitignore`
You can’t perform that action at this time.
0 commit comments