@@ -40,10 +40,10 @@ There are several options on how to proceed with the replacement and implementat
40
40
41
41
## Decision Drivers
42
42
43
- - Reduce maintenance effort.
43
+ - Reduce maintenance effort
44
44
- Fit into our use-cases (especially with FluxCD)
45
45
46
- ## Artifact
46
+ ## Artifact (How to store and reference the single layer OCI artifacts)
47
47
48
48
An artifact in the current context describes a resource that holds an identity to a blob and a pointer where to find
49
49
the blob (currently a URL). In that sense, a producer can create an artifact and store this information and a consumer
@@ -68,9 +68,7 @@ transformation, they also can be used as a caching mechanism to reduce unnecessa
68
68
[ ` SnapshotSpec ` ] [ snapshot-spec ]
69
69
- Identity: OCM Identity (map[ string] string) (Created by [ constructIdentity()] [ snapshot-create-identity ] )
70
70
- Digest: OCI Layer Digest (Based on [ go-containerregistry OCI implementation] [ go-containerregistry-digest ] )
71
- - Probably to check if the blob that the ` snapshot ` is pointing to is already equal to a newly created blob
72
71
- Tag: The version (e.g. ` latest ` , ` v1.0.0 ` , ..., see [ reference] [ snapshot-version-ref ]
73
- - Purpose?
74
72
- (Suspend)
75
73
76
74
[ ` SnapshotStatus ` ] [ snapshot-status ]
@@ -96,11 +94,31 @@ transformation, they also can be used as a caching mechanism to reduce unnecessa
96
94
[ ` ArtifactStatus ` ] [ artifact-status ]
97
95
- No fields
98
96
99
- ### Options
97
+ ### Considered Options
98
+
99
+ * Option 1: Omit the ` artifact ` /` snapshot ` concept
100
+ * Option 2: Use the ` snapshot ` implementation
101
+ * Option 3: Use the ` artifact ` implementation
102
+ * Option 4: Use ` OCIRepository ` implementation from ` FluxCD `
103
+ * Option 5: Create a new custom resource
104
+
105
+ ### Decision Outcome
106
+
107
+ Chosen option: "Option 2: Use the ` snapshot ` implementation", because it is already implemented in the
108
+ ` ocm-controllers ` v1 and fits our use-cases most.
109
+
110
+ #### Positive Consequences
100
111
101
- The following sections discusses several options .
112
+ - Most of the functionality is already implemented, can be copied, and adjusted/refactored to our design .
102
113
103
- #### Option 1: Omit the ` artifact ` /` snapshot ` concept (Rejected)
114
+ #### Negative Consequences
115
+
116
+ - Requires a transformer that transforms the ` snapshot ` resource in something that, for example, FluxCDs
117
+ ` source-controller ` can consume. For this, the FluxCDs ` OCIRepository ` resource seems predestined.
118
+
119
+ ### Pros and Cons of the Options
120
+
121
+ #### Option 1: Omit the ` artifact ` /` snapshot ` concept
104
122
105
123
Instead of using an intermediate Custom Resource as ` artifact ` or ` snapshot ` , one could update the status of the source
106
124
resource that is creating the blob could point to the location of that blob itself.
@@ -112,7 +130,7 @@ Cons:
112
130
- Since there is a "real" blob in the storage, it should have a respective entity to represent it, e.g.
113
131
` artifact ` /` snapshot `
114
132
115
- #### Option 2: Use the ` snapshot ` implementation (accepted)
133
+ #### Option 2: Use the ` snapshot ` implementation
116
134
117
135
Pros:
118
136
- Already implemented (and probably tested).
@@ -124,7 +142,7 @@ FluxCDs `source-controller` and its CR `OCIRepository`.
124
142
- Implemented in ` open-component-model/ocm-controller ` which will be archived, when the ` ocm-controller ` v2 go
125
143
productive. Thus, the ` snapshot ` implementation must be copied in this repository.
126
144
127
- #### Option 3: Use the ` artifact ` implementation (rejected)
145
+ #### Option 3: Use the ` artifact ` implementation
128
146
129
147
Pros:
130
148
- Already implemented (and a bit tested)
@@ -137,7 +155,7 @@ Cons:
137
155
138
156
Basically rejected because we could only use the ` Artifact ` type definition and not the implementation for the storage.
139
157
140
- #### Option 4: Use ` OCIRepository ` implementation from ` FluxCD ` (rejected)
158
+ #### Option 4: Use ` OCIRepository ` implementation from ` FluxCD `
141
159
142
160
See [ definition] [ oci-repository-type ] . The type is part of the FluxCDs ` source-controller ` , which also
143
161
provides a control-loop for that resource.
@@ -159,7 +177,7 @@ local storage (plain http server).
159
177
Using ` OCIRepository ` as intermediate ` storage ` -pointer CR is not an option as the control-loop of that resource would
160
178
"clone" any OCI Registry blob to its own local storage.
161
179
162
- #### Option 5: Create a new custom resource (rejected)
180
+ #### Option 5: Create a new custom resource
163
181
164
182
Pros:
165
183
- Greenfield approach.
@@ -171,25 +189,32 @@ Cons:
171
189
Creating a new custom resource seems like an overkill, considering that the ` snapshot ` implementation covers a lot of
172
190
our use-cases. Thus, it seems more reasonable to go with the ` snapshot ` implementation and adjust/refactor that.
173
191
174
- ### Conclusion
175
192
176
- - Option 1: Omitting a dedicated resource for the storage objects is not a good design-choice.
177
- - Option 2: The ` snapshot ` implementation fits our purposes and is already implemented.
178
- - Option 3: The current ` artifact ` implementation is not feasible as it was written for another purpose.
179
- - Option 4: The FluxCDs ` OCIRepository ` resource has major implications to our environment that are not beneficial.
180
- - Option 5: Creating a new custom resource feels like an overkill since it requires a new implementation.
193
+ ## (Internal) OCI Registry (How to setup the internal OCI registry and which one to use)
194
+ ...
181
195
182
- Therefore, option 2 is chosen as it is reasonable to use the already implemented ` snapshot ` resource and adjust it to
183
- our purposes.
196
+ ### Considered Options
184
197
185
- This approach requires a transformer to make the final resource consumable. For this, the FluxCDs ` OCIRepository `
186
- resource seems predestined, since ` OCIRepository ` can be consumed by FluxCDs ` source-controller ` (most use-cases) as
187
- well as by ArgoCD.
198
+ * Option 1: Let the user provide a registry that is OCI compliant
199
+ * Option 2: Deploy an OCI image registry with our controllers
200
+ * Option 2.1: Use implementation from ocm-controllers v1
201
+ * Option 2.2: Use [ ` zot ` ] ( https://github.com/project-zot/zot )
188
202
189
- ## (Internal) OCI Registry
190
- ...
203
+ ### Decision Outcome
204
+
205
+ Chosen option: "???", because...
206
+
207
+ #### Positive Consequences
208
+
209
+ * …
191
210
192
- ### Option 1: Let the user provide a registry that is OCI compliant
211
+ #### Negative Consequences
212
+
213
+ * …
214
+
215
+ ### Pros and Cons of the Options
216
+
217
+ #### Option 1: Let the user provide a registry that is OCI compliant
193
218
194
219
Pros:
195
220
- Not our responsibility
@@ -200,9 +225,9 @@ Cons:
200
225
- We do not "control" the resource and issues caused by another OCI registry could be hard to fix/support
201
226
- ...
202
227
203
- ### Option 2: Deploy an OCI image registry with our controllers
228
+ #### Option 2: Deploy an OCI image registry with our controllers
204
229
205
- ### Option 2.1: Use implementation from ocm-controllers v1
230
+ ##### Option 2.1: Use implementation from ocm-controllers v1
206
231
207
232
Pros:
208
233
- Already implemented.
@@ -211,7 +236,7 @@ Pros:
211
236
Cons:
212
237
- ...
213
238
214
- ### Option 2.2: Use [ ` zot ` ] ( https://github.com/project-zot/zot )
239
+ ###### Option 2.2: Use [ ` zot ` ] ( https://github.com/project-zot/zot )
215
240
216
241
Pros:
217
242
- Is the newest shot
@@ -222,11 +247,10 @@ Cons:
222
247
- Implement from scratch (probably not true)
223
248
- ...
224
249
225
- ## Links
250
+ # Links
226
251
- Epic [ #75 ] ( https://github.com/open-component-model/ocm-k8s-toolkit/issues/75 )
227
252
- Issue [ #90 ] ( https://github.com/open-component-model/ocm-k8s-toolkit/issues/90 )
228
253
229
-
230
254
[ artifact-definition ] : https://github.com/openfluxcd/artifact/blob/d9db932260eb5f847737bcae3589b653398780ae/api/v1alpha1/artifact_types.go#L30
231
255
[ fluxcd-rfc ] : https://github.com/fluxcd/flux2/discussions/5058
232
256
[ snapshot-definition ] : https://github.com/open-component-model/ocm-controller/blob/8588071a05532abd28916931963f88b16622e44d/api/v1alpha1/snapshot_types.go#L22
0 commit comments