Skip to content

Commit 8a5731c

Browse files
csviriCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 398abaf commit 8a5731c

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

docs/content/en/blog/news/read-after-write-consistency.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ and naturally also for subsequent reconciliations.
1414

1515
I briefly [talked about this](https://www.youtube.com/watch?v=HrwHh5Yh6AM&t=1387s) topic at KubeCon last year.
1616

17-
```java
18-
17+
```java
1918
public UpdateControl<WebPage> reconcile(WebPage webPage, Context<WebPage> context) {
2019

2120
ConfigMap managedConfigMap = prepareConfigMap(webPage);
@@ -25,8 +24,8 @@ public UpdateControl<WebPage> reconcile(WebPage webPage, Context<WebPage> contex
2524
// fresh resource instantly available from our update in the caches
2625
var upToDateResource = context.getSecondaryResource(ConfigMap.class);
2726

28-
// from now on built in update methods by default use this feature;
29-
// it is guaranteed that resource changes will be visible for next reconciliation
27+
// from now on built-in update methods by default use this feature;
28+
// it is guaranteed that resource changes will be visible for next reconciliation
3029
return UpdateControl.patchStatus(alterStatusObject(webPage));
3130
}
3231
```
@@ -106,7 +105,7 @@ public UpdateControl<PrefixedPod> reconcile(PrefixedPod primary, Context<Prefixe
106105
Optional<Pod> currentPod = context.getSecondaryResource(Pod.class);
107106

108107
if (currentPod.isPresent()) {
109-
if (podNameHasPrefix(primary.getSpec().getPodNamePrexix() ,currentPod.get())) {
108+
if (podNameHasPrefix(primary.getSpec().getPodNamePrefix() ,currentPod.get())) {
110109
// all ok we can return
111110
return UpdateControl.noUpdate();
112111
} else {
@@ -123,8 +122,8 @@ public UpdateControl<PrefixedPod> reconcile(PrefixedPod primary, Context<Prefixe
123122
}
124123

125124
@Override
126-
public List<EventSource<?, WebPage>> prepareEventSources(EventSourceContext<WebPage> context) {
127-
// Code omitted for adding InformerEventsSource for the Pod
125+
public List<EventSource<?, PrefixedPod>> prepareEventSources(EventSourceContext<PrefixedPod> context) {
126+
// Code omitted for adding InformerEventSource for the Pod
128127
}
129128
```
130129

@@ -171,7 +170,7 @@ Although with optimistic locking we were able to overcome this issue — see [th
171170

172171
{{% alert color=success %}}
173172
This changed in the Kubernetes guidelines. Now, if we can parse the `resourceVersion` as an integer,
174-
we can use numerical comparison. See the related [KEP](https://github.com/michaelasp/enhancements/tree/master/keps/sig-api-machinery/5504-comparable-resource-version).
173+
we can use numerical comparison. See the related [KEP](https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/5504-comparable-resource-version).
175174
{{% /alert %}}
176175

177176
From this point the idea of the algorithm is very simple:

docs/content/en/blog/releases/v5-3-release.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ If your reconciler relied on being re-triggered by its own writes, a new `resche
5454
> in-flight updates. Use `context.getSecondaryResources(..)` or `InformerEventSource.get(ResourceID)`
5555
> instead.
5656
57-
See the related [blog post](../news/read-after-write-consistency.md)
58-
and [reconciler docs](/docs/documentation/reconciler#read-cache-after-write-consistency-and-event-filtering) for details.
57+
See the related [blog post](../news/read-after-write-consistency.md) and [reconciler docs](/docs/documentation/reconciler#read-cache-after-write-consistency-and-event-filtering) for details.
5958

6059
### MicrometerMetricsV2
6160

0 commit comments

Comments
 (0)