Skip to content

Commit 3d8f7f3

Browse files
committed
rebase on next
1 parent c70678e commit 3d8f7f3

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

Diff for: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java

+17-10
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import io.fabric8.kubernetes.api.model.HasMetadata;
1212
import io.fabric8.kubernetes.api.model.Secret;
1313
import io.fabric8.zjsonpatch.JsonDiff;
14-
import io.javaoperatorsdk.operator.api.config.ConfigurationServiceProvider;
1514
import io.javaoperatorsdk.operator.api.reconciler.Context;
1615
import io.javaoperatorsdk.operator.processing.dependent.Matcher;
1716

1817
import com.fasterxml.jackson.databind.JsonNode;
18+
import com.fasterxml.jackson.databind.ObjectMapper;
1919

2020
public class GenericKubernetesResourceMatcher<R extends HasMetadata, P extends HasMetadata>
2121
implements Matcher<R, P> {
@@ -58,7 +58,7 @@ static <R extends HasMetadata, P extends HasMetadata> Matcher<R, P> matcherFor(
5858
public Result<R> match(R actualResource, P primary, Context<P> context) {
5959
var desired = dependentResource.desired(primary, context);
6060
return match(desired, actualResource, false, false, false,
61-
context.getControllerConfiguration().getConfigurationService().getObjectMapper());
61+
context.getControllerConfiguration().getConfigurationService().getObjectMapper());
6262
}
6363

6464
/**
@@ -91,9 +91,9 @@ public Result<R> match(R actualResource, P primary, Context<P> context) {
9191
*/
9292
public static <R extends HasMetadata> Result<R> match(R desired, R actualResource,
9393
boolean considerLabelsAndAnnotations, boolean labelsAndAnnotationsEquality,
94-
boolean specEquality,ObjectMapper objectMapper) {
94+
boolean specEquality, ObjectMapper objectMapper) {
9595
return match(desired, actualResource, considerLabelsAndAnnotations,
96-
labelsAndAnnotationsEquality, specEquality,objectMapper, EMPTY_ARRAY);
96+
labelsAndAnnotationsEquality, specEquality, objectMapper, EMPTY_ARRAY);
9797
}
9898

9999
/**
@@ -120,7 +120,7 @@ public static <R extends HasMetadata> Result<R> match(R desired, R actualResourc
120120
boolean considerLabelsAndAnnotations, boolean labelsAndAnnotationsEquality,
121121
ObjectMapper objectMapper, String... ignorePaths) {
122122
return match(desired, actualResource, considerLabelsAndAnnotations,
123-
labelsAndAnnotationsEquality, false,objectMapper, ignorePaths);
123+
labelsAndAnnotationsEquality, false, objectMapper, ignorePaths);
124124
}
125125

126126
/**
@@ -152,11 +152,13 @@ public static <R extends HasMetadata> Result<R> match(R desired, R actualResourc
152152
public static <R extends HasMetadata, P extends HasMetadata> Result<R> match(
153153
KubernetesDependentResource<R, P> dependentResource, R actualResource, P primary,
154154
Context<P> context, boolean considerLabelsAndAnnotations,
155-
boolean labelsAndAnnotationsEquality,ObjectMapper objectMapper,
155+
boolean labelsAndAnnotationsEquality,
156156
String... ignorePaths) {
157157
final var desired = dependentResource.desired(primary, context);
158158
return match(desired, actualResource, considerLabelsAndAnnotations,
159-
labelsAndAnnotationsEquality, ignorePaths);
159+
labelsAndAnnotationsEquality, context.getControllerConfiguration()
160+
.getConfigurationService().getObjectMapper(),
161+
ignorePaths);
160162
}
161163

162164
public static <R extends HasMetadata, P extends HasMetadata> Result<R> match(
@@ -166,11 +168,13 @@ public static <R extends HasMetadata, P extends HasMetadata> Result<R> match(
166168
boolean specEquality) {
167169
final var desired = dependentResource.desired(primary, context);
168170
return match(desired, actualResource, considerLabelsAndAnnotations,
169-
labelsAndAnnotationsEquality, specEquality);
171+
labelsAndAnnotationsEquality, specEquality, context.getControllerConfiguration()
172+
.getConfigurationService().getObjectMapper());
170173
}
171174

172175
private static <R extends HasMetadata> Result<R> match(R desired, R actualResource,
173176
boolean considerMetadata, boolean labelsAndAnnotationsEquality, boolean specEquality,
177+
ObjectMapper objectMapper,
174178
String... ignoredPaths) {
175179
final List<String> ignoreList =
176180
ignoredPaths != null && ignoredPaths.length > 0 ? Arrays.asList(ignoredPaths)
@@ -298,15 +302,18 @@ public static <R extends HasMetadata, P extends HasMetadata> Result<R> match(
298302
KubernetesDependentResource<R, P> dependentResource, R actualResource, P primary,
299303
Context<P> context, boolean considerLabelsAndAnnotations, boolean specEquality) {
300304
final var desired = dependentResource.desired(primary, context);
301-
return match(desired, actualResource, considerLabelsAndAnnotations, specEquality, context.getControllerConfiguration().getConfigurationService().getObjectMapper());
305+
return match(desired, actualResource, considerLabelsAndAnnotations, specEquality,
306+
context.getControllerConfiguration().getConfigurationService().getObjectMapper());
302307
}
303308

304309
@Deprecated(forRemoval = true)
305310
public static <R extends HasMetadata, P extends HasMetadata> Result<R> match(
306311
KubernetesDependentResource<R, P> dependentResource, R actualResource, P primary,
307312
Context<P> context, boolean considerLabelsAndAnnotations, String... ignorePaths) {
308313
final var desired = dependentResource.desired(primary, context);
309-
return match(desired, actualResource, considerLabelsAndAnnotations, true, context.getControllerConfiguration().getConfigurationService().getObjectMapper(), ignorePaths);
314+
return match(desired, actualResource, considerLabelsAndAnnotations, true,
315+
context.getControllerConfiguration().getConfigurationService().getObjectMapper(),
316+
ignorePaths);
310317
}
311318

312319
}

Diff for: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public Result<R> match(R actualResource, P primary, Context<P> context) {
143143
@SuppressWarnings("unused")
144144
public Result<R> match(R actualResource, R desired, P primary, Context<P> context) {
145145
return GenericKubernetesResourceMatcher.match(desired, actualResource, false,
146-
false, false,context.getControllerConfiguration().getConfigurationService().getObjectMapper());
146+
false, false,
147+
context.getControllerConfiguration().getConfigurationService().getObjectMapper());
147148
}
148149

149150
protected void handleDelete(P primary, R secondary, Context<P> context) {

0 commit comments

Comments
 (0)