You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/design/dependency-resolution.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,23 @@
2
2
3
3
OLM manages the dependency resolution and upgrade lifecycle of running operators. In many ways, thes problems OLM faces are similar to other OS package managers like `apt`/`dkpg` and `yum`/`rpm`.
4
4
5
-
However, there is one constraint that similar systems don't generally have that OLM does: because operators are always running, OLM attempts to ensure that at no point in time are you left with a set of operators that do not work with each other.
5
+
However, there is one constraint that similar systems don't generally have that OLM does: because operators are always running, OLM attempts to ensure that at no point in time are you left with a set of operators that do not work with each other.
6
6
7
7
This means that OLM needs to never:
8
-
8
+
9
9
- install a set of operators that require APIs that can't be provided
10
10
- update an operator in a way that breaks another that depends upon it
11
-
11
+
12
12
The following examples motivate why OLM's dependency resolution and upgrade strategy works as it does, followed by a description of the current algorithm.
13
13
14
+
## CustomResourceDefinition (CRD) Upgrade
15
+
16
+
OLM will upgrade CRD right away if it is owned by singular CSV. If CRD is owned by multiple CSVs, then CRD is upgraded when it is
17
+
satisfied all of the following backward compatible conditions:
18
+
19
+
- All existing versions in current CRD are present in new CRD
20
+
- All existing instances (Custom Resource) of current CRD are valid when validated against new CRD's validation schema
21
+
14
22
# Example: Deprecate dependant API
15
23
16
24
A and B are APIs (e.g. CRDs)
@@ -41,7 +49,7 @@ If we attempt to update A without simultaneously updating B, or vice-versa, we w
41
49
This is another case we prevent with OLM's upgrade strategy.
42
50
43
51
44
-
# Dependency resolution
52
+
# Dependency resolution
45
53
46
54
A Provider is an operator which "Owns" a CRD or APIService.
47
55
@@ -55,12 +63,12 @@ Consider the set of operators defined by running operators in a namespace:
55
63
provisionally add the operator to the generation
56
64
else
57
65
check for a replacement in the source/package/channel
58
-
66
+
59
67
// Generation resolution
60
68
For each required API with no provider in gen:
61
69
search through prioritized sources to pick a provider
62
70
provisionally add any new operators found to the generation, this could also add to the required APIs without providers
63
-
71
+
64
72
// Downgrade
65
73
if there are still required APIs that can't be satisfied by sources:
66
74
downgrade the operator(s) that require the APIs that can't be satisfied
0 commit comments