11
11
import io .fabric8 .kubernetes .api .model .HasMetadata ;
12
12
import io .fabric8 .kubernetes .api .model .Secret ;
13
13
import io .fabric8 .zjsonpatch .JsonDiff ;
14
- import io .javaoperatorsdk .operator .api .config .ConfigurationServiceProvider ;
15
14
import io .javaoperatorsdk .operator .api .reconciler .Context ;
16
15
import io .javaoperatorsdk .operator .processing .dependent .Matcher ;
17
16
18
17
import com .fasterxml .jackson .databind .JsonNode ;
18
+ import com .fasterxml .jackson .databind .ObjectMapper ;
19
19
20
20
public class GenericKubernetesResourceMatcher <R extends HasMetadata , P extends HasMetadata >
21
21
implements Matcher <R , P > {
@@ -58,7 +58,7 @@ static <R extends HasMetadata, P extends HasMetadata> Matcher<R, P> matcherFor(
58
58
public Result <R > match (R actualResource , P primary , Context <P > context ) {
59
59
var desired = dependentResource .desired (primary , context );
60
60
return match (desired , actualResource , false , false , false ,
61
- context .getControllerConfiguration ().getConfigurationService ().getObjectMapper ());
61
+ context .getControllerConfiguration ().getConfigurationService ().getObjectMapper ());
62
62
}
63
63
64
64
/**
@@ -91,9 +91,9 @@ public Result<R> match(R actualResource, P primary, Context<P> context) {
91
91
*/
92
92
public static <R extends HasMetadata > Result <R > match (R desired , R actualResource ,
93
93
boolean considerLabelsAndAnnotations , boolean labelsAndAnnotationsEquality ,
94
- boolean specEquality ,ObjectMapper objectMapper ) {
94
+ boolean specEquality , ObjectMapper objectMapper ) {
95
95
return match (desired , actualResource , considerLabelsAndAnnotations ,
96
- labelsAndAnnotationsEquality , specEquality ,objectMapper , EMPTY_ARRAY );
96
+ labelsAndAnnotationsEquality , specEquality , objectMapper , EMPTY_ARRAY );
97
97
}
98
98
99
99
/**
@@ -120,7 +120,7 @@ public static <R extends HasMetadata> Result<R> match(R desired, R actualResourc
120
120
boolean considerLabelsAndAnnotations , boolean labelsAndAnnotationsEquality ,
121
121
ObjectMapper objectMapper , String ... ignorePaths ) {
122
122
return match (desired , actualResource , considerLabelsAndAnnotations ,
123
- labelsAndAnnotationsEquality , false ,objectMapper , ignorePaths );
123
+ labelsAndAnnotationsEquality , false , objectMapper , ignorePaths );
124
124
}
125
125
126
126
/**
@@ -152,11 +152,13 @@ public static <R extends HasMetadata> Result<R> match(R desired, R actualResourc
152
152
public static <R extends HasMetadata , P extends HasMetadata > Result <R > match (
153
153
KubernetesDependentResource <R , P > dependentResource , R actualResource , P primary ,
154
154
Context <P > context , boolean considerLabelsAndAnnotations ,
155
- boolean labelsAndAnnotationsEquality ,ObjectMapper objectMapper ,
155
+ boolean labelsAndAnnotationsEquality ,
156
156
String ... ignorePaths ) {
157
157
final var desired = dependentResource .desired (primary , context );
158
158
return match (desired , actualResource , considerLabelsAndAnnotations ,
159
- labelsAndAnnotationsEquality , ignorePaths );
159
+ labelsAndAnnotationsEquality , context .getControllerConfiguration ()
160
+ .getConfigurationService ().getObjectMapper (),
161
+ ignorePaths );
160
162
}
161
163
162
164
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(
166
168
boolean specEquality ) {
167
169
final var desired = dependentResource .desired (primary , context );
168
170
return match (desired , actualResource , considerLabelsAndAnnotations ,
169
- labelsAndAnnotationsEquality , specEquality );
171
+ labelsAndAnnotationsEquality , specEquality , context .getControllerConfiguration ()
172
+ .getConfigurationService ().getObjectMapper ());
170
173
}
171
174
172
175
private static <R extends HasMetadata > Result <R > match (R desired , R actualResource ,
173
176
boolean considerMetadata , boolean labelsAndAnnotationsEquality , boolean specEquality ,
177
+ ObjectMapper objectMapper ,
174
178
String ... ignoredPaths ) {
175
179
final List <String > ignoreList =
176
180
ignoredPaths != null && ignoredPaths .length > 0 ? Arrays .asList (ignoredPaths )
@@ -298,15 +302,18 @@ public static <R extends HasMetadata, P extends HasMetadata> Result<R> match(
298
302
KubernetesDependentResource <R , P > dependentResource , R actualResource , P primary ,
299
303
Context <P > context , boolean considerLabelsAndAnnotations , boolean specEquality ) {
300
304
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 ());
302
307
}
303
308
304
309
@ Deprecated (forRemoval = true )
305
310
public static <R extends HasMetadata , P extends HasMetadata > Result <R > match (
306
311
KubernetesDependentResource <R , P > dependentResource , R actualResource , P primary ,
307
312
Context <P > context , boolean considerLabelsAndAnnotations , String ... ignorePaths ) {
308
313
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 );
310
317
}
311
318
312
319
}
0 commit comments