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 {
138
138
// OCILayerSelector specifies which layer should be extracted from an OCI Artifact
139
139
type OCILayerSelector struct {
140
140
// 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.
142
143
// +optional
143
144
MediaType string `json:"mediaType,omitempty"`
144
145
}
Original file line number Diff line number Diff line change 82
82
properties :
83
83
mediaType :
84
84
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.
86
87
type : string
87
88
type : object
88
89
provider :
Original file line number Diff line number Diff line change @@ -2571,7 +2571,8 @@ string
2571
2571
<td >
2572
2572
<em >(Optional)</em >
2573
2573
<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 >
2575
2576
</td >
2576
2577
</tr >
2577
2578
</tbody >
Original file line number Diff line number Diff line change @@ -368,6 +368,30 @@ spec:
368
368
369
369
This field takes precedence over all other fields.
370
370
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
+
371
395
# ## Ignore
372
396
373
397
` .spec.ignore` is an optional field to specify rules in [the `.gitignore`
You can’t perform that action at this time.
0 commit comments