@@ -116,6 +116,52 @@ public static <R extends HasMetadata> Result<R> match(R desired, R actualResourc
116
116
labelsAndAnnotationsEquality , false , ignorePaths );
117
117
}
118
118
119
+ /**
120
+ * Determines whether the specified actual resource matches the desired state defined by the
121
+ * specified {@link KubernetesDependentResource} based on the observed state of the associated
122
+ * specified primary resource.
123
+ *
124
+ * @param dependentResource the {@link KubernetesDependentResource} implementation used to compute
125
+ * the desired state associated with the specified primary resource
126
+ * @param actualResource the observed dependent resource for which we want to determine whether it
127
+ * matches the desired state or not
128
+ * @param primary the primary resource from which we want to compute the desired state
129
+ * @param context the {@link Context} instance within which this method is called
130
+ * @param considerLabelsAndAnnotations {@code true} to consider the metadata of the actual
131
+ * resource when determining if it matches the desired state, {@code false} if matching
132
+ * should occur only considering the spec of the resources
133
+ * @param labelsAndAnnotationsEquality if true labels and annotation match exactly in the actual
134
+ * and desired state if false, additional elements are allowed in actual annotations.
135
+ * Considered only if considerLabelsAndAnnotations is true.
136
+ * @param <R> the type of resource we want to determine whether they match or not
137
+ * @param <P> the type of primary resources associated with the secondary resources we want to
138
+ * match
139
+ * @param ignorePaths are paths in the resource that are ignored on matching (basically an ignore
140
+ * list). All changes with a target prefix path on a calculated JSON Patch between actual
141
+ * and desired will be ignored. If there are other changes, non-present on ignore list
142
+ * match fails.
143
+ * @return a {@link io.javaoperatorsdk.operator.processing.dependent.Matcher.Result} object
144
+ */
145
+ public static <R extends HasMetadata , P extends HasMetadata > Result <R > match (
146
+ KubernetesDependentResource <R , P > dependentResource , R actualResource , P primary ,
147
+ Context <P > context , boolean considerLabelsAndAnnotations ,
148
+ boolean labelsAndAnnotationsEquality ,
149
+ String ... ignorePaths ) {
150
+ final var desired = dependentResource .desired (primary , context );
151
+ return match (desired , actualResource , considerLabelsAndAnnotations ,
152
+ labelsAndAnnotationsEquality , ignorePaths );
153
+ }
154
+
155
+ public static <R extends HasMetadata , P extends HasMetadata > Result <R > match (
156
+ KubernetesDependentResource <R , P > dependentResource , R actualResource , P primary ,
157
+ Context <P > context , boolean considerLabelsAndAnnotations ,
158
+ boolean labelsAndAnnotationsEquality ,
159
+ boolean specEquality ) {
160
+ final var desired = dependentResource .desired (primary , context );
161
+ return match (desired , actualResource , considerLabelsAndAnnotations ,
162
+ labelsAndAnnotationsEquality , specEquality );
163
+ }
164
+
119
165
private static <R extends HasMetadata > Result <R > match (R desired , R actualResource ,
120
166
boolean considerMetadata , boolean labelsAndAnnotationsEquality , boolean specEquality ,
121
167
String ... ignoredPaths ) {
@@ -258,49 +304,4 @@ public static <R extends HasMetadata, P extends HasMetadata> Result<R> match(
258
304
return match (desired , actualResource , considerLabelsAndAnnotations , true , ignorePaths );
259
305
}
260
306
261
- /**
262
- * Determines whether the specified actual resource matches the desired state defined by the
263
- * specified {@link KubernetesDependentResource} based on the observed state of the associated
264
- * specified primary resource.
265
- *
266
- * @param dependentResource the {@link KubernetesDependentResource} implementation used to compute
267
- * the desired state associated with the specified primary resource
268
- * @param actualResource the observed dependent resource for which we want to determine whether it
269
- * matches the desired state or not
270
- * @param primary the primary resource from which we want to compute the desired state
271
- * @param context the {@link Context} instance within which this method is called
272
- * @param considerLabelsAndAnnotations {@code true} to consider the metadata of the actual
273
- * resource when determining if it matches the desired state, {@code false} if matching
274
- * should occur only considering the spec of the resources
275
- * @param labelsAndAnnotationsEquality if true labels and annotation match exactly in the actual
276
- * and desired state if false, additional elements are allowed in actual annotations.
277
- * Considered only if considerLabelsAndAnnotations is true.
278
- * @param <R> the type of resource we want to determine whether they match or not
279
- * @param <P> the type of primary resources associated with the secondary resources we want to
280
- * match
281
- * @param ignorePaths are paths in the resource that are ignored on matching (basically an ignore
282
- * list). All changes with a target prefix path on a calculated JSON Patch between actual
283
- * and desired will be ignored. If there are other changes, non-present on ignore list
284
- * match fails.
285
- * @return a {@link io.javaoperatorsdk.operator.processing.dependent.Matcher.Result} object
286
- */
287
- public static <R extends HasMetadata , P extends HasMetadata > Result <R > match (
288
- KubernetesDependentResource <R , P > dependentResource , R actualResource , P primary ,
289
- Context <P > context , boolean considerLabelsAndAnnotations ,
290
- boolean labelsAndAnnotationsEquality ,
291
- String ... ignorePaths ) {
292
- final var desired = dependentResource .desired (primary , context );
293
- return match (desired , actualResource , considerLabelsAndAnnotations ,
294
- labelsAndAnnotationsEquality , ignorePaths );
295
- }
296
-
297
- public static <R extends HasMetadata , P extends HasMetadata > Result <R > match (
298
- KubernetesDependentResource <R , P > dependentResource , R actualResource , P primary ,
299
- Context <P > context , boolean considerLabelsAndAnnotations ,
300
- boolean labelsAndAnnotationsEquality ,
301
- boolean specEquality ) {
302
- final var desired = dependentResource .desired (primary , context );
303
- return match (desired , actualResource , considerLabelsAndAnnotations ,
304
- labelsAndAnnotationsEquality , specEquality );
305
- }
306
307
}
0 commit comments