You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/AbstractTestReconciler.java
1. Dependent resources are explicitly created and can be access later by reference.
310
-
2. Event sources are produced by the dependent resources, but needs to be explicitly registered in
311
-
this case by implementing
312
-
the [`EventSourceInitializer`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/EventSourceInitializer.java)
313
-
interface.
314
-
3. The input html is validated, and error message is set in case it is invalid.
315
-
4. Reconciliation of dependent resources is called explicitly, but here the workflow
316
-
customization is fully in the hand of the developer.
317
-
5. An `Ingress` is created but only in case `exposed` flag set to true on custom resource. Tries to
318
-
delete it if not.
319
-
6. Status is set in a different way, this is just an alternative way to show, that the actual state
320
-
can be read using the reference. This could be written in a same way as in the managed example.
Note also the Workflows feature makes it possible to also support this conditional creation use
327
-
case in managed dependent resources.
233
+
You can see a commented example of how to do
234
+
so [here](https://github.com/operator-framework/java-operator-sdk/blob/main/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStandaloneDependentsReconciler.java).
328
235
329
236
## Creating/Updating Kubernetes Resources
330
237
@@ -357,17 +264,17 @@ Since SSA is a complex feature, JOSDK implements a feature flag allowing users t
357
264
these implementations. See
358
265
in [ConfigurationService](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L332-L358).
359
266
360
-
It is, however, important to note that these implementations are default, generic
361
-
implementations that the framework can provide expected behavior out of the box. In many
362
-
situations, these will work just fine but it is also possible to provide matching algorithms
267
+
It is, however, important to note that these implementations are default, generic
268
+
implementations that the framework can provide expected behavior out of the box. In many
269
+
situations, these will work just fine but it is also possible to provide matching algorithms
363
270
optimized for specific use cases. This is easily done by simply overriding
364
-
the `match(...)`[method](https://github.com/java-operator-sdk/java-operator-sdk/blob/e16559fd41bbb8bef6ce9d1f47bffa212a941b09/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L156-L156).
271
+
the `match(...)`[method](https://github.com/java-operator-sdk/java-operator-sdk/blob/e16559fd41bbb8bef6ce9d1f47bffa212a941b09/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L156-L156).
365
272
366
-
It is also possible to bypass the matching logic altogether to simply rely on the server-side
273
+
It is also possible to bypass the matching logic altogether to simply rely on the server-side
367
274
apply mechanism if always sending potentially unchanged resources to the cluster is not an issue.
368
275
JOSDK's matching mechanism allows to spare some potentially useless calls to the Kubernetes API
369
-
server. To bypass the matching feature completely, simply override the `match` method to always
370
-
return `false`, thus telling JOSDK that the actual state never matches the desired one, making
276
+
server. To bypass the matching feature completely, simply override the `match` method to always
277
+
return `false`, thus telling JOSDK that the actual state never matches the desired one, making
371
278
it always update the resources using SSA.
372
279
373
280
WARNING: Older versions of Kubernetes before 1.25 would create an additional resource version for every SSA update
@@ -489,15 +396,18 @@ also be created, one per dependent resource.
489
396
See [integration test](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/ExternalStateBulkIT.java)
490
397
as a sample.
491
398
492
-
493
399
## GenericKubernetesResource based Dependent Resources
494
400
495
-
In rare circumstances resource handling where there is no class representation or just typeless handling might be needed.
For dependent resource this is supported by [GenericKubernetesDependentResource](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesDependentResource.java#L8-L8)
500
-
. See samples [here](https://github.com/java-operator-sdk/java-operator-sdk/tree/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/generickubernetesresource).
407
+
For dependent resource this is supported
408
+
by [GenericKubernetesDependentResource](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesDependentResource.java#L8-L8)
0 commit comments