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
Until version 5 changing primary resource through `UpdateControl` did not use server-side apply.
24
-
So usually the implementation of reconciler looked something like this:
23
+
Until version 5, changing primary resources through `UpdateControl` did not use server-side apply.
24
+
So usually, the implementation of the reconciler looked something like this:
25
25
26
26
```java
27
27
@@ -36,15 +36,15 @@ So usually the implementation of reconciler looked something like this:
36
36
37
37
```
38
38
39
-
In other words, after reconciliation of managed resources, the reconciler updates the status on the
40
-
primary resource passed as argument to the reconciler.
41
-
Such changes on primary are fine since we don't work directly with the cached object, the argument is
39
+
In other words, after the reconciliation of managed resources, the reconciler updates the status of the
40
+
primary resource passed as an argument to the reconciler.
41
+
Such changes on the primary are fine since we don't work directly with the cached object, the argument is
42
42
already cloned.
43
43
44
-
So how does this change with SSA?
44
+
So, how does this change with SSA?
45
45
For SSA, the updates should contain (only) the "fully specified intent".
46
-
In other words, we should fill only the values that we care about.
47
-
In practice means creating a **fresh copy** of the resource and setting only what is necessary:
46
+
In other words, we should only fill in the values we care about.
47
+
In practice, it means creating a **fresh copy** of the resource and setting only what is necessary:
48
48
49
49
```java
50
50
@@ -64,35 +64,26 @@ public UpdateControl<WebPage> reconcile(WebPage webPage, Context<WebPage> contex
64
64
}
65
65
```
66
66
67
-
Note that we just filled the status here, since we patch the status (not the resource spec).
67
+
Note that we just filled out the status here since we patched the status (not the resource spec).
68
68
Since the status is a sub-resource in Kubernetes, it will only update the status part.
69
69
70
-
Every controller you register will have its own default [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#managers).
70
+
Every controller you register will have its default [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#managers).
71
71
You can override the field manager name using [`ControllerConfiguration.fieldManager`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java#L89).
72
-
That will set the field manager for the updates of the primary resource and dependent resources.
72
+
That will set the field manager for the primary resource and dependent resources as well.
73
73
74
74
## Migrating to SSA
75
75
76
76
Using the legacy or the new SSA way of resource management works well.
77
77
However, migrating existing resources to SSA might be a challenge.
78
-
So we strongly encourage everyone to test the migration, thus write an integration test where
79
-
a custom resource is created using legacy approach is getting managed by new approach.
78
+
We strongly recommend testing the migration, thus implementing an integration test where
79
+
a custom resource is created using the legacy approach and is managed by the new approach.
80
80
81
-
We prepared an integration test to demonstrate how such migration even in a simple case can go wrong,
81
+
We prepared an integration test to demonstrate how such migration, even in a simple case, can go wrong,
82
82
and how to fix it.
83
83
84
84
To fix some cases, you might need to [strip managed fields](https://kubernetes.io/docs/reference/using-api/server-side-apply/#clearing-managedfields)
85
85
from the custom resource.
86
86
87
87
See [`StatusPatchSSAMigrationIT`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchSSAMigrationIT.java) for details.
88
88
89
-
Also feel free to report common issues, so we can in case prepare some utilities to handle them.
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
89
+
Feel free to report common issues, so we can prepare some utilities to handle them.
0 commit comments