Skip to content

Commit 26b11fb

Browse files
committed
Rework of the optional manifest enhancement proposal:
- to use group, kind, namespace, name for identifying manifests instead of filenames - adding graduation criteria - adding test strategy - clarifying the case of StatusReasonAlreadyExists Signed-off-by: Frederic Giloux <[email protected]>
1 parent 7664ab3 commit 26b11fb

File tree

1 file changed

+31
-86
lines changed

1 file changed

+31
-86
lines changed

enhancements/optional-manifest.md

Lines changed: 31 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ superseded-by:
2424

2525
- [x] Enhancement is `implementable`
2626
- [x] Design details are appropriately documented from clear requirements
27-
- [ ] Test plan is defined
28-
- [ ] Graduation criteria for dev preview, tech preview, GA
27+
- [x] Test plan is defined
28+
- [x] Graduation criteria for dev preview, tech preview, GA
2929
- [ ] User-facing documentation is created in [olm-docs](https://github.com/operator-framework/olm-docs/)
3030

3131
## Summary
@@ -52,20 +52,25 @@ ServiceMonitor and VerticalPodAutoscaler are among the supported resources. They
5252

5353
A resource can be marked as optional by leveraging [Explicit Bundle Properties](https://github.com/operator-framework/enhancements/blob/master/enhancements/properties.md). Therefore a new file can be added to the bundle metadata directory. The file itself can have any name, but it has to be in the top-level metadata directory of the bundle and to consist of YAML with a top-level `properties` element containing an array of type/value tuples. There should be a single file containing a top-level `properties` element.
5454

55-
The property type for optional manifest is `olm.manifests.optional`. Its value field is a `files` structure, which contains a list of optional files.
55+
The property type for optional manifest is `olm.manifests.optional`. Its value field is a `manifests` structure, which contains a list of optional manifests. These manifests are identified by group, kind, namespace and name. The namespace value is optional. For cluster scoped resources or resources where no namespace is specified in the manifest file the field has to be empty.
5656

5757
Example:
5858

5959
~~~
6060
properties:
6161
- type: 'olm.manifests.optional'
6262
value:
63-
files:
64-
- verticalpodautoscaler.yaml
65-
- servicemonitor.yaml
63+
manifests:
64+
- group: monitoring.coreos.com
65+
kind: PrometheusRule
66+
namespace: my-namespace
67+
name: my-rule
68+
- group: autoscaling.k8s.io/v1
69+
kind: VerticalPodAutoscaler
70+
name: my-vpa
6671
~~~
6772

68-
If a file listed in the property file does not exist in the bundle manifest directory it will be ignored without further hints.
73+
If a manifest listed in the property file does not exist in the bundle manifest directory it will be ignored without further hints.
6974

7075
It does not make sense to list a resource core to OLM (ClusterServiceVersion) or resources shipped with Kubernetes under `olm.manifests.optional` as the availability of the API is a prerequisite for OLM to work. This means that no extra check will be implemented for the following types:
7176

@@ -171,7 +176,7 @@ When OLM requests the API server to create an optional manifest there are 3 pote
171176
[1] The logic used in OLM to differentiate when the API is not available from other errors is as follows:
172177

173178
~~~
174-
if k8serrors.IsNotFound(err) {
179+
if apierrors.IsNotFound(err) {
175180
notFoundErr := discoveryQuerier.WithStepResource(step.Resource).QueryForGVK()
176181
if notFoundErr != nil {
177182
return notFoundErr
@@ -186,7 +191,6 @@ For optional manifests we will differentiate between errors that are specific to
186191
- StatusReasonUnauthorized 401
187192
- StatusReasonForbidden 403
188193
- StatusReasonNotFound 404
189-
- StatusReasonAlreadyExists 409
190194
- StatusReasonInvalid 442
191195
- StatusReasonNotAcceptable 406
192196
- StatusReasonUnsupportedMediaType 415
@@ -205,6 +209,8 @@ For optional manifests we will differentiate between errors that are specific to
205209
- StatusReasonExpired 410
206210
- StatusReasonServiceUnavailable 503
207211

212+
StatusReasonAlreadyExists 409: it is a special case as the error is [caught during object creation](https://github.com/operator-framework/operator-lifecycle-manager/blob/d6346a1c0507c765145a0b6bb18e9f06bc4058c4/pkg/controller/operators/catalog/step_ensurer.go#L307-L325) and an update is performed instead.
213+
208214
### Risks and Mitigations
209215

210216
The change is very localised so that the risks are low. The interpretation of the property `olm.manifests.optional` is also 100% backward compatible: Resources not listed under it continue to be created and mandatory for the InstallPlan to succeed. Having a file in the optional list and the operator deployed on a cluster with an OLM version not having this enhancement means that the property is just ignored and the previous behaviour stays unchanged.
@@ -217,91 +223,26 @@ The logic in any future solution for bundle distribution, like RukPak, would nee
217223

218224
### Test Plan
219225

220-
**Note:** *Section not required until targeted at a release.*
221-
222-
Consider the following in developing a test plan for this enhancement:
223-
- Will there be e2e and integration tests, in addition to unit tests?
224-
- How will it be tested in isolation vs with other components?
225-
226-
No need to outline all of the test cases, just the general strategy. Anything
227-
that would count as tricky in the implementation and anything particularly
228-
challenging to test should be called out.
229-
230-
All code is expected to have adequate tests (eventually with coverage
231-
expectations).
232-
233-
### Graduation Criteria
234-
235-
**Note:** *Section not required until targeted at a release.*
236-
237-
Define graduation milestones.
238-
239-
These may be defined in terms of API maturity, or as something else. Initial proposal
240-
should keep this high-level with a focus on what signals will be looked at to
241-
determine graduation.
242-
243-
Consider the following in developing the graduation criteria for this
244-
enhancement:
245-
- Maturity levels - `Dev Preview`, `Tech Preview`, `GA`
246-
- Deprecation
247-
248-
Clearly define what graduation means.
249-
250-
#### Examples
226+
Code coverage for this enhancement is ensured by two set of unit tests.
251227

252-
These are generalized examples to consider, in addition to the aforementioned
253-
[maturity levels][maturity-levels].
228+
- Validation that a resource is properly identified as optional based on the Properties that have been configured.
229+
- Step processing:
230+
- Validation that a step flagged as optional does not cause the failure of the InstallPlan if it cannot be successfully processed due to one of the API errors listed above as NotCreated.
231+
- Validation that a step flagged as optional still fails the InstallPlan due to one of the API errors listed above as Failure.
232+
- Validation that the logic has not changed for non optional steps
254233

255-
##### Dev Preview -> Tech Preview
234+
### Feature gate
256235

257-
- Ability to utilize the enhancement end to end
258-
- End user documentation, relative API stability
259-
- Sufficient test coverage
260-
- Gather feedback from users rather than just developers
236+
The optional manifest feature is currently scheduled to be available in the next release with no feature gate. It will first be provided with no guarantee of API (the configuration through explicite bundle properties) stability and begins to gather users' feedbacks.
261237

262-
##### Tech Preview -> GA
238+
As the feature is being used and evaluated API changes can be made to improve its overall usefulness and user experience. Such changes may not be backward compatible with the first verion of its API.
263239

264-
- More testing (upgrade, downgrade, scale)
265-
- Sufficient time for feedback
266-
- Available by default
267-
268-
**For non-optional features moving to GA, the graduation criteria must include
269-
end to end tests.**
270-
271-
##### Removing a deprecated feature
272-
273-
- Announce deprecation and support policy of the existing feature
274-
- Deprecate the feature
275-
276-
### Upgrade / Downgrade Strategy
277-
278-
If applicable, how will the component be upgraded and downgraded? Make sure this
279-
is in the test plan.
280-
281-
Consider the following in developing an upgrade/downgrade strategy for this
282-
enhancement:
283-
- What changes (in invocations, configurations, API use, etc.) is an existing
284-
cluster required to make on upgrade in order to keep previous behavior?
285-
- What changes (in invocations, configurations, API use, etc.) is an existing
286-
cluster required to make on upgrade in order to make use of the enhancement?
287-
288-
### Version Skew Strategy
289-
290-
How will the component handle version skew with other components?
291-
What are the guarantees? Make sure this is in the test plan.
292-
293-
Consider the following in developing a version skew strategy for this
294-
enhancement:
295-
- During an upgrade, we will always have skew among components, how will this impact your work?
296-
- Does this enhancement involve coordinating behavior in the control plane and
297-
in the kubelet? How does an n-2 kubelet without this feature available behave
298-
when this feature is used?
299-
- Will any other components on the node change? For example, changes to CSI, CRI
300-
or CNI may require updating that component before the kubelet.
240+
If the feature does not see adoption it will be deprecated and get eventually removed.
301241

302242
## Implementation History
303243

304-
2021.10.06 First draft
244+
- 2021.10.06 First draft
245+
- 2022.03.30 Second draft
305246

306247
## Drawbacks
307248

@@ -352,6 +293,10 @@ The reasoning behind the exclusion of the above list is:
352293
- The list of mandatory or optional resources cannot can be seen in one place.
353294
- The "Explicit Bundle Properties" mechanism already exists. Using a manifest annotation introduces an additional control mechanism.
354295

296+
### Identfication by filenames
297+
298+
The approach is similar to the current enhancement proposal with the difference that manifests are identified by filenames instead of /group/kind/namespace/name. This was challenged by the fact that filenames may not be available when the gRPC API is used to process bundles.
299+
355300
### Operator dependencies
356301

357302
Implementing the support of full blown operator dependencies and forcing implicit dependencies to become explicit. In that case the optionality is defined at the API level rather than at the resource level.

0 commit comments

Comments
 (0)