Skip to content

Commit d861161

Browse files
committed
simplify
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 13ed4c3 commit d861161

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

Diff for: docs/content/en/blog/news/nonssa-vs-ssa.md

+3-21
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,9 @@ Feel free to report common issues, so we can prepare some utilities to handle th
9090

9191
## Optimistic concurrency control
9292

93-
When you create a resource for SSA as mentioned above:
94-
95-
```java
96-
@Override
97-
public UpdateControl<WebPage> reconcile(WebPage webPage, Context<WebPage> context) {
98-
99-
reconcileLogicForManagedResources(webPage);
100-
101-
WebPage statusPatch = new WebPage();
102-
statusPatch.setMetadata(new ObjectMetaBuilder()
103-
.withName(webPage.getMetadata().getName())
104-
.withNamespace(webPage.getMetadata().getNamespace())
105-
.build());
106-
statusPatch.setStatus(updatedStatusForWebPage(webPage));
107-
108-
return UpdateControl.patchStatus(statusPatch);
109-
}
110-
```
111-
112-
It will apply changes even if the underlying resource or status subresource is changed while the reconciliation was running.
113-
First, the framework always forces the conflicts in the background as advised in [Kubernetes docs](https://kubernetes.io/docs/reference/using-api/server-side-apply/#using-server-side-apply-in-a-controller),
93+
When you create a resource for SSA as mentioned above, the framework will apply changes even if the underlying resource
94+
or status subresource is changed while the reconciliation was running.
95+
First, it always forces the conflicts in the background as advised in [Kubernetes docs](https://kubernetes.io/docs/reference/using-api/server-side-apply/#using-server-side-apply-in-a-controller),
11496
in addition to that since the resource version is not set it won't do optimistic locking. If you still
11597
want to have optimistic locking for the patch, use the resource version of the original resource:
11698

0 commit comments

Comments
 (0)