@@ -45,6 +45,12 @@ const (
45
45
// AzureOCIProvider provides support for OCI authentication using a Azure Service Principal,
46
46
// Managed Identity or Shared Key.
47
47
AzureOCIProvider string = "azure"
48
+
49
+ // OCILayerExtract defines the operation type for extracting the content from an OCI artifact layer.
50
+ OCILayerExtract = "extract"
51
+
52
+ // OCILayerCopy defines the operation type for copying the content from an OCI artifact layer.
53
+ OCILayerCopy = "copy"
48
54
)
49
55
50
56
// OCIRepositorySpec defines the desired state of OCIRepository
@@ -156,6 +162,14 @@ type OCILayerSelector struct {
156
162
// first layer matching this type is selected.
157
163
// +optional
158
164
MediaType string `json:"mediaType,omitempty"`
165
+
166
+ // Operation specifies how the selected layer should be processed.
167
+ // By default, the layer compressed content is extracted to storage.
168
+ // When the operation is set to 'copy', the layer compressed content
169
+ // is persisted to storage as it is.
170
+ // +kubebuilder:validation:Enum=extract;copy
171
+ // +optional
172
+ Operation string `json:"operation,omitempty"`
159
173
}
160
174
161
175
// OCIRepositoryVerification verifies the authenticity of an OCI Artifact
@@ -231,6 +245,15 @@ func (in *OCIRepository) GetLayerMediaType() string {
231
245
return in .Spec .LayerSelector .MediaType
232
246
}
233
247
248
+ // GetLayerOperation returns the layer selector operation (defaults to extract).
249
+ func (in * OCIRepository ) GetLayerOperation () string {
250
+ if in .Spec .LayerSelector == nil || in .Spec .LayerSelector .Operation == "" {
251
+ return OCILayerExtract
252
+ }
253
+
254
+ return in .Spec .LayerSelector .Operation
255
+ }
256
+
234
257
// +genclient
235
258
// +genclient:Namespaced
236
259
// +kubebuilder:storageversion
0 commit comments