From 125206ef8290e82e4be833c5ca4e9ad4151ab643 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 26 May 2025 07:31:04 +0000 Subject: [PATCH 01/43] Set new SNAPSHOT version into pom files. --- bootstrapper-maven-plugin/pom.xml | 2 +- caffeine-bounded-cache-support/pom.xml | 2 +- micrometer-support/pom.xml | 2 +- operator-framework-bom/pom.xml | 2 +- operator-framework-core/pom.xml | 2 +- operator-framework-junit5/pom.xml | 2 +- operator-framework/pom.xml | 2 +- pom.xml | 2 +- sample-operators/controller-namespace-deletion/pom.xml | 2 +- sample-operators/leader-election/pom.xml | 2 +- sample-operators/mysql-schema/pom.xml | 2 +- sample-operators/pom.xml | 2 +- sample-operators/tomcat-operator/pom.xml | 2 +- sample-operators/webpage/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bootstrapper-maven-plugin/pom.xml b/bootstrapper-maven-plugin/pom.xml index 7487daa6fd..eaa32eb009 100644 --- a/bootstrapper-maven-plugin/pom.xml +++ b/bootstrapper-maven-plugin/pom.xml @@ -5,7 +5,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT bootstrapper diff --git a/caffeine-bounded-cache-support/pom.xml b/caffeine-bounded-cache-support/pom.xml index a421b3cd9f..c45e56386d 100644 --- a/caffeine-bounded-cache-support/pom.xml +++ b/caffeine-bounded-cache-support/pom.xml @@ -4,7 +4,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT caffeine-bounded-cache-support diff --git a/micrometer-support/pom.xml b/micrometer-support/pom.xml index 9d9a47464f..73ed6ff77e 100644 --- a/micrometer-support/pom.xml +++ b/micrometer-support/pom.xml @@ -4,7 +4,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT micrometer-support diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index 123ae032c7..ccbb4ca4e2 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -4,7 +4,7 @@ io.javaoperatorsdk operator-framework-bom - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT pom Operator SDK - Bill of Materials Java SDK for implementing Kubernetes operators diff --git a/operator-framework-core/pom.xml b/operator-framework-core/pom.xml index b4166a3761..69c02d6f01 100644 --- a/operator-framework-core/pom.xml +++ b/operator-framework-core/pom.xml @@ -4,7 +4,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT ../pom.xml diff --git a/operator-framework-junit5/pom.xml b/operator-framework-junit5/pom.xml index 111fdf3b1b..07bfa9cd1c 100644 --- a/operator-framework-junit5/pom.xml +++ b/operator-framework-junit5/pom.xml @@ -4,7 +4,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT operator-framework-junit-5 diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml index 0d60152818..18cbda43cf 100644 --- a/operator-framework/pom.xml +++ b/operator-framework/pom.xml @@ -4,7 +4,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT operator-framework diff --git a/pom.xml b/pom.xml index 6bc27adeed..586930f0b3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT pom Operator SDK for Java Java SDK for implementing Kubernetes operators diff --git a/sample-operators/controller-namespace-deletion/pom.xml b/sample-operators/controller-namespace-deletion/pom.xml index 75ef1ee5eb..9a87338da5 100644 --- a/sample-operators/controller-namespace-deletion/pom.xml +++ b/sample-operators/controller-namespace-deletion/pom.xml @@ -5,7 +5,7 @@ io.javaoperatorsdk sample-operators - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT sample-controller-namespace-deletion diff --git a/sample-operators/leader-election/pom.xml b/sample-operators/leader-election/pom.xml index 5611726540..ca74158ae6 100644 --- a/sample-operators/leader-election/pom.xml +++ b/sample-operators/leader-election/pom.xml @@ -5,7 +5,7 @@ io.javaoperatorsdk sample-operators - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT sample-leader-election diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml index 263a832d10..94b2f93769 100644 --- a/sample-operators/mysql-schema/pom.xml +++ b/sample-operators/mysql-schema/pom.xml @@ -5,7 +5,7 @@ io.javaoperatorsdk sample-operators - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT sample-mysql-schema-operator diff --git a/sample-operators/pom.xml b/sample-operators/pom.xml index d89c0677d6..2f1c9c1645 100644 --- a/sample-operators/pom.xml +++ b/sample-operators/pom.xml @@ -5,7 +5,7 @@ io.javaoperatorsdk java-operator-sdk - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT sample-operators diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml index 0bc6f86eda..38d6b4ec0c 100644 --- a/sample-operators/tomcat-operator/pom.xml +++ b/sample-operators/tomcat-operator/pom.xml @@ -5,7 +5,7 @@ io.javaoperatorsdk sample-operators - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT sample-tomcat-operator diff --git a/sample-operators/webpage/pom.xml b/sample-operators/webpage/pom.xml index d2bfacc70e..7f118be1bb 100644 --- a/sample-operators/webpage/pom.xml +++ b/sample-operators/webpage/pom.xml @@ -5,7 +5,7 @@ io.javaoperatorsdk sample-operators - 5.1.1-SNAPSHOT + 5.1.2-SNAPSHOT sample-webpage-operator From 9891064e11b30dde5b861681c7dcadd9f9177e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Tue, 27 May 2025 08:53:37 +0200 Subject: [PATCH 02/43] blog: primary resource caching (#2815) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros Signed-off-by: Chris Laprun Co-authored-by: Martin Stefanko Co-authored-by: Chris Laprun --- .../blog/news/primary-cache-for-next-recon.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 docs/content/en/blog/news/primary-cache-for-next-recon.md diff --git a/docs/content/en/blog/news/primary-cache-for-next-recon.md b/docs/content/en/blog/news/primary-cache-for-next-recon.md new file mode 100644 index 0000000000..67326a6f17 --- /dev/null +++ b/docs/content/en/blog/news/primary-cache-for-next-recon.md @@ -0,0 +1,92 @@ +--- +title: How to guarantee allocated values for next reconciliation +date: 2025-05-22 +author: >- + [Attila Mészáros](https://github.com/csviri) and [Chris Laprun](https://github.com/metacosm) +--- + +We recently released v5.1 of Java Operator SDK (JOSDK). One of the highlights of this release is related to a topic of +so-called +[allocated values](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#representing-allocated-values +). + +To describe the problem, let's say that our controller needs to create a resource that has a generated identifier, i.e. +a resource which identifier cannot be directly derived from the custom resource's desired state as specified in its +`spec` field. To record the fact that the resource was successfully created, and to avoid attempting to +recreate the resource again in subsequent reconciliations, it is typical for this type of controller to store the +generated identifier in the custom resource's `status` field. + +The Java Operator SDK relies on the informers' cache to retrieve resources. These caches, however, are only guaranteed +to be eventually consistent. It could happen that, if some other event occurs, that would result in a new +reconciliation, **before** the update that's been made to our resource status has the chance to be propagated first to +the cluster and then back to the informer cache, that the resource in the informer cache does **not** contain the latest +version as modified by the reconciler. This would result in a new reconciliation where the generated identifier would be +missing from the resource status and, therefore, another attempt to create the resource by the reconciler, which is not +what we'd like. + +Java Operator SDK now provides a utility class [ +`PrimaryUpdateAndCacheUtils`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java) +to handle this particular use case. Using that overlay cache, your reconciler is guaranteed to see the most up-to-date +version of the resource on the next reconciliation: + +```java + +@Override +public UpdateControl reconcile( + StatusPatchCacheCustomResource resource, + Context context) { + + // omitted code + + var freshCopy = createFreshCopy(resource); // need fresh copy just because we use the SSA version of update + freshCopy + .getStatus() + .setValue(statusWithAllocatedValue()); + + // using the utility instead of update control to patch the resource status + var updated = + PrimaryUpdateAndCacheUtils.ssaPatchStatusAndCacheResource(resource, freshCopy, context); + return UpdateControl.noUpdate(); +} +``` + +How does `PrimaryUpdateAndCacheUtils` work? +There are multiple ways to solve this problem, but ultimately, we only provide the solution described below. If you +want to dig deep in alternatives, see +this [PR](https://github.com/operator-framework/java-operator-sdk/pull/2800/files). + +The trick is to intercept the resource that the reconciler updated and cache that version in an additional cache on top +of the informer's cache. Subsequently, if the reconciler needs to read the resource, the SDK will first check if it is +in the overlay cache and read it from there if present, otherwise read it from the informer's cache. If the informer +receives an event with a fresh resource, we always remove the resource from the overlay cache, since that is a more +recent resource. But this **works only** if the reconciler updates the resource using **optimistic locking**. +If the update fails on conflict, because the resource has already been updated on the cluster before we got +the chance to get our update in, we simply wait and poll the informer cache until the new resource version from the +server appears in the informer's cache, +and then try to apply our updates to the resource again using the updated version from the server, again with optimistic +locking. + +So why is optimistic locking required? We hinted at it above, but the gist of it, is that if another party updates the +resource before we get a chance to, we wouldn't be able to properly handle the resulting situation correctly in all +cases. The informer would receive that new event before our own update would get a chance to propagate. Without +optimistic locking, there wouldn't be a fail-proof way to determine which update should prevail (i.e. which occurred +first), in particular in the event of the informer losing the connection to the cluster or other edge cases (the joys of +distributed computing!). + +Optimistic locking simplifies the situation and provides us with stronger guarantees: if the update succeeds, then we +can be sure we have the proper resource version in our caches. The next event will contain our update in all cases. +Because we know that, we can also be sure that we can evict the cached resource in the overlay cache whenever we receive +a new event. The overlay cache is only used if the SDK detects that the original resource (i.e. the one before we +applied our status update in the example above) is still in the informer's cache. + +The following diagram sums up the process: + +```mermaid +flowchart TD + A["Update Resource with Lock"] --> B{"Is Successful"} + B -- Fails on conflict --> D["Poll the Informer cache until resource updated"] + D --> A + B -- Yes --> n2{"Original resource still in informer cache?"} + n2 -- Yes --> C["Cache the resource in overlay cache"] + n2 -- No --> n3["Informer cache already contains up-to-date version, do not use overlay cache"] +``` From 98c4deac9d56a4719f79aee0ce35eab6ca2dd881 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 09:12:56 +0200 Subject: [PATCH 03/43] chore(deps): bump com.diffplug.spotless:spotless-maven-plugin (#2819) Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.44.4 to 2.44.5. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.4...maven/2.44.5) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-version: 2.44.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 586930f0b3..d6bb27d726 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 3.1.4 9.0.2 3.4.5 - 2.44.4 + 2.44.5 From e961dcb5b04c1e239838e2c5b9d18a48f239f672 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 14:06:25 +0200 Subject: [PATCH 04/43] chore(deps): bump org.slf4j:slf4j-api from 2.0.12 to 2.0.17 (#2705) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): bump org.slf4j:slf4j-api from 2.0.12 to 2.0.17 Bumps org.slf4j:slf4j-api from 2.0.12 to 2.0.17. --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update pom.xml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Attila Mészáros --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d6bb27d726..55bd5d6a93 100644 --- a/pom.xml +++ b/pom.xml @@ -59,10 +59,9 @@ java-operator-sdk https://sonarcloud.io jdk - 5.12.2 7.3.1 - 2.0.12 + 2.0.17 2.24.3 5.18.0 3.17.0 From a2bf2e477b353ab626ef1b216d14420fb140f3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Fri, 30 May 2025 12:40:26 +0200 Subject: [PATCH 05/43] docs: fix dependent resource sample docs (#2822) --- .../dependent-resources.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/content/en/docs/documentation/dependent-resource-and-workflows/dependent-resources.md b/docs/content/en/docs/documentation/dependent-resource-and-workflows/dependent-resources.md index 304e20bafe..43b7f37364 100644 --- a/docs/content/en/docs/documentation/dependent-resource-and-workflows/dependent-resources.md +++ b/docs/content/en/docs/documentation/dependent-resource-and-workflows/dependent-resources.md @@ -133,7 +133,7 @@ Deleted (or set to be garbage collected). The following example shows how to cre ```java -@KubernetesDependent(labelSelector = WebPageManagedDependentsReconciler.SELECTOR) +@KubernetesDependent(informer = @Informer(labelSelector = SELECTOR)) class DeploymentDependentResource extends CRUDKubernetesDependentResource { @Override @@ -174,7 +174,8 @@ JOSDK will take the appropriate steps to wire everything together and call your `DependentResource` implementations `reconcile` method before your primary resource is reconciled. This makes sense in most use cases where the logic associated with the primary resource is usually limited to status handling based on the state of the secondary resources and the -resources are not dependent on each other. +resources are not dependent on each other. As an alternative, you can also invoke reconciliation explicitly, +event for managed workflows. See [Workflows](https://javaoperatorsdk.io/docs/workflows) for more details on how the dependent resources are reconciled. @@ -184,12 +185,14 @@ instances are managed by JOSDK, an example of which can be seen below: ```java -@ControllerConfiguration( - labelSelector = SELECTOR, +@Workflow( dependents = { @Dependent(type = ConfigMapDependentResource.class), @Dependent(type = DeploymentDependentResource.class), - @Dependent(type = ServiceDependentResource.class) + @Dependent(type = ServiceDependentResource.class), + @Dependent( + type = IngressDependentResource.class, + reconcilePrecondition = ExposedIngressCondition.class) }) public class WebPageManagedDependentsReconciler implements Reconciler, ErrorStatusHandler { @@ -204,7 +207,6 @@ public class WebPageManagedDependentsReconciler webPage.setStatus(createStatus(name)); return UpdateControl.patchStatus(webPage); } - } ``` From 6ebf5f076ab74516bf0763f0c6c67ce694176dbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 08:18:12 +0200 Subject: [PATCH 06/43] chore(deps): bump org.apache.maven.plugins:maven-clean-plugin (#2823) Bumps [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.4.1 to 3.5.0. - [Release notes](https://github.com/apache/maven-clean-plugin/releases) - [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.4.1...maven-clean-plugin-3.5.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-clean-plugin dependency-version: 3.5.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 55bd5d6a93..17a4cdaf1b 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ 3.3.1 3.3.1 3.4.2 - 3.4.1 + 3.5.0 3.2.7 1.7.0 3.0.0 From 127e87de9a078d9436e35e33470ea32fc907e508 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 08:53:40 +0200 Subject: [PATCH 07/43] chore(deps): bump org.junit:junit-bom from 5.12.2 to 5.13.0 (#2824) Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.12.2 to 5.13.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.12.2...r5.13.0) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 5.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 17a4cdaf1b..d4d4397747 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ java-operator-sdk https://sonarcloud.io jdk - 5.12.2 + 5.13.0 7.3.1 2.0.17 2.24.3 From 470ac9e19475cf3f3d89be456ed27b3b47082501 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 08:05:29 +0200 Subject: [PATCH 08/43] chore(deps): bump io.micrometer:micrometer-core from 1.15.0 to 1.15.1 (#2828) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d4d4397747..f4dd22edbc 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 3.27.3 4.3.0 2.7.3 - 1.15.0 + 1.15.1 3.2.0 0.9.14 2.19.0 From 3143822c754c8f88c3442ed41fab67cc7e29f2a2 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Mon, 16 Jun 2025 16:18:57 +0200 Subject: [PATCH 09/43] refactor: remove unused ResourceUpdaterMatcher interface (#2830) Signed-off-by: Chris Laprun --- .../operator/api/config/ConfigurationService.java | 4 ---- .../dependent/kubernetes/ResourceUpdaterMatcher.java | 11 ----------- 2 files changed, 15 deletions(-) delete mode 100644 operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/ResourceUpdaterMatcher.java diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java index 18e74d29a9..864b65c3f7 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java @@ -28,7 +28,6 @@ import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependent; import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependentResource; import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependentResourceConfig; -import io.javaoperatorsdk.operator.processing.dependent.kubernetes.ResourceUpdaterMatcher; import io.javaoperatorsdk.operator.processing.dependent.workflow.ManagedWorkflowFactory; import io.javaoperatorsdk.operator.processing.event.source.controller.ControllerEventSource; @@ -396,9 +395,6 @@ default boolean shouldUseSSA( Class dependentResourceType, Class resourceType, KubernetesDependentResourceConfig config) { - if (ResourceUpdaterMatcher.class.isAssignableFrom(dependentResourceType)) { - return false; - } Boolean useSSAConfig = Optional.ofNullable(config).map(KubernetesDependentResourceConfig::useSSA).orElse(null); // don't use SSA for certain resources by default, only if explicitly overridden diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/ResourceUpdaterMatcher.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/ResourceUpdaterMatcher.java deleted file mode 100644 index d893ff3e86..0000000000 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/ResourceUpdaterMatcher.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.javaoperatorsdk.operator.processing.dependent.kubernetes; - -import io.fabric8.kubernetes.api.model.HasMetadata; -import io.javaoperatorsdk.operator.api.reconciler.Context; - -public interface ResourceUpdaterMatcher { - - R updateResource(R actual, R desired, Context context); - - boolean matches(R actual, R desired, Context context); -} From 9f75a494bb5eb33e1e91efb947c75327fa830dd7 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Mon, 16 Jun 2025 19:03:50 +0200 Subject: [PATCH 10/43] feat: add retrieval of RegisteredController by name (#2829) * feat: add retrieval of RegisteredController by name Signed-off-by: Chris Laprun --- .../javaoperatorsdk/operator/RuntimeInfo.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/RuntimeInfo.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/RuntimeInfo.java index b7fbce7f07..0495131d79 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/RuntimeInfo.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/RuntimeInfo.java @@ -5,6 +5,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import io.fabric8.kubernetes.api.model.HasMetadata; import io.javaoperatorsdk.operator.health.EventSourceHealthIndicator; import io.javaoperatorsdk.operator.health.InformerWrappingEventSourceHealthIndicator; import io.javaoperatorsdk.operator.processing.event.source.controller.ControllerEventSource; @@ -22,7 +23,7 @@ public class RuntimeInfo { private final Operator operator; public RuntimeInfo(Operator operator) { - this.registeredControllers = operator.getRegisteredControllers(); + this.registeredControllers = Collections.unmodifiableSet(operator.getRegisteredControllers()); this.operator = operator; } @@ -30,6 +31,7 @@ public boolean isStarted() { return operator.isStarted(); } + @SuppressWarnings("unused") public Set getRegisteredControllers() { checkIfStarted(); return registeredControllers; @@ -80,4 +82,23 @@ public Map> unhealthyEventSource } return res; } + + /** + * Retrieves the {@link RegisteredController} associated with the specified controller name or + * {@code null} if no such controller is registered. + * + * @param controllerName the name of the {@link RegisteredController} to retrieve + * @return the {@link RegisteredController} associated with the specified controller name or + * {@code null} if no such controller is registered + * @since 5.1.2 + */ + @SuppressWarnings({"unchecked", "unused"}) + public RegisteredController getRegisteredController( + String controllerName) { + checkIfStarted(); + return registeredControllers.stream() + .filter(rc -> rc.getConfiguration().getName().equals(controllerName)) + .findFirst() + .orElse(null); + } } From fe0c44490470e800983ef6727887b23590978158 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 08:29:57 +0200 Subject: [PATCH 11/43] chore(deps): bump log4j.version from 2.24.3 to 2.25.0 (#2833) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f4dd22edbc..916b41e151 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 5.13.0 7.3.1 2.0.17 - 2.24.3 + 2.25.0 5.18.0 3.17.0 0.21.0 From 301859af74905f3b7e69532b1463a38baeb90503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Thu, 19 Jun 2025 11:42:27 +0200 Subject: [PATCH 12/43] docs: add note about cncf to readme (#2834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- README.md | 4 ++++ docs/static/images/cncf_logo2.png | Bin 0 -> 19132 bytes 2 files changed, 4 insertions(+) create mode 100644 docs/static/images/cncf_logo2.png diff --git a/README.md b/README.md index 86edf232b0..fecef691a6 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ conversion hooks and dynamic admission controllers are supported as a separate p Under the hood it uses the excellent [Fabric8 Kubernetes Client](https://github.com/fabric8io/kubernetes-client), which provides additional facilities, like generating CRD from source code (and vice versa). +Icon + +Java Operator SDK is a CNCF project as part of [Operator Framework](https://github.com/operator-framework). + ## Documentation Documentation can be found on the **[JOSDK WebSite](https://javaoperatorsdk.io/)**. diff --git a/docs/static/images/cncf_logo2.png b/docs/static/images/cncf_logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..e1236b7e87568d325ec0be4079298d4991b3458f GIT binary patch literal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6L@g(U?Ck_h(r7=k<~Si`JsATT?K yH5>y!Z;!CEhufWj!R%o$H5u3N{{#_{!8b$5e=Q(aL{`ZK3YSryu6541^xpwYX{nF^ literal 0 HcmV?d00001 From cec37251a06c1aecdb298b059716a19342d33fc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 10:17:00 +0200 Subject: [PATCH 13/43] chore(deps): bump com.google.cloud.tools:jib-maven-plugin (#2837) Bumps [com.google.cloud.tools:jib-maven-plugin](https://github.com/GoogleContainerTools/jib) from 3.4.5 to 3.4.6. - [Release notes](https://github.com/GoogleContainerTools/jib/releases) - [Commits](https://github.com/GoogleContainerTools/jib/commits) --- updated-dependencies: - dependency-name: com.google.cloud.tools:jib-maven-plugin dependency-version: 3.4.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 916b41e151..b4a0bb9c2b 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 3.0.0 3.1.4 9.0.2 - 3.4.5 + 3.4.6 2.44.5 From eb135d216dc1bc1fc39d66e046f3d5dfa1711d8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 07:34:25 +0200 Subject: [PATCH 14/43] chore(deps): bump com.github.ben-manes.caffeine:caffeine (#2827) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b4a0bb9c2b..1cd306fd64 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 4.3.0 2.7.3 1.15.1 - 3.2.0 + 3.2.1 0.9.14 2.19.0 4.15 From 3520732016b9e8b1391e28f5686bd1fce3e87d7b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:36:25 +0200 Subject: [PATCH 15/43] chore(deps): bump org.junit:junit-bom from 5.13.0 to 5.13.2 (#2839) Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 5.13.0 to 5.13.2. - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.0...r5.13.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 5.13.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1cd306fd64..0162bb0849 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ java-operator-sdk https://sonarcloud.io jdk - 5.13.0 + 5.13.2 7.3.1 2.0.17 2.25.0 From 1a01e50315762b0c2d495cdd56fd15d1ac17f3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Fri, 27 Jun 2025 09:00:16 +0200 Subject: [PATCH 16/43] docs: fix links and mention status utility in faq (#2841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- docs/content/en/docs/faq/_index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/content/en/docs/faq/_index.md b/docs/content/en/docs/faq/_index.md index 9308ce4cfa..10a15c0eac 100644 --- a/docs/content/en/docs/faq/_index.md +++ b/docs/content/en/docs/faq/_index.md @@ -90,7 +90,10 @@ reconciliation. For example if you patch the status at the end of the reconcilia it is not guaranteed that during the next reconciliation you will see the fresh resource. Therefore, controllers which do this, usually cache the updated status in memory to make sure it is present for next reconciliation. -Dependent Resources feature supports the [first approach](../dependent-resources/_index.md#external-state-tracking-dependent-resources). +From version 5.1 you can use [this utility](../documentation/reconciler.md#making-sure-the-primary-resource-is-up-to-date-for-the-next-reconciliation) +to make sure an updated status is present for the next reconciliation. + +Dependent Resources feature supports the [first approach](../documentation/dependent-resource-and-workflows/dependent-resources.md#external-state-tracking-dependent-resources). ### How can I skip the reconciliation of a dependent resource? From 099191a272ba6b5490cd6eb06a204c2f210f742a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Fri, 27 Jun 2025 11:52:40 +0200 Subject: [PATCH 17/43] docs: add faq entry regarding event filtering (#2842) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- docs/content/en/docs/faq/_index.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/content/en/docs/faq/_index.md b/docs/content/en/docs/faq/_index.md index 10a15c0eac..23a6ea2743 100644 --- a/docs/content/en/docs/faq/_index.md +++ b/docs/content/en/docs/faq/_index.md @@ -95,6 +95,32 @@ to make sure an updated status is present for the next reconciliation. Dependent Resources feature supports the [first approach](../documentation/dependent-resource-and-workflows/dependent-resources.md#external-state-tracking-dependent-resources). +### How can I make the status update of my custom resource trigger a reconciliation? + +For the primary resource, the framework by default specially checks if the change on the primary +resource is increased the `generation` field in the metadata, and filters out the related event if not. +This field is increased when `.spec` of the resource is changed. Therefore, a change in the `.status` field +will not trigger a reconciliation. + +To change this behavior, you can set the [`generationAwareEventProcessing`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java#L43) +to `false`: + +```java +@ControllerConfiguration(generationAwareEventProcessing = false) + static class TestCustomReconciler implements Reconciler { + + @Override + public UpdateControl reconcile(TestCustomResource resource, Context context) { + // code omitted + } + } +``` + +For secondary resources, every change should trigger a reconciliation by default. +Except when you add explicit filter or use dependent resources that by default filter out own changes, +see [related docs](../documentation/dependent-resource-and-workflows/dependent-resources.md#caching-and-event-handling-in-kubernetesdependentresource). + + ### How can I skip the reconciliation of a dependent resource? Skipping workflow reconciliation altogether is possible with the explicit invocation feature since v5. From 8db818c234e6fef61097620a181b4f3253fc1412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Fri, 27 Jun 2025 12:28:53 +0200 Subject: [PATCH 18/43] docs: add kroxylicious operator to the list (#2843) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fecef691a6..72eb2f7974 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ projects want to advertise that fact here. For this reason, we ask that if you'd to be featured in this section, please open a PR, adding a link to and short description of your project, as shown below: +- [kroxylicious](https://github.com/kroxylicious/kroxylicious/tree/main/kroxylicious-operator) Kafka proxy operator - [ExposedApp operator](https://github.com/halkyonio/exposedapp-rhdblog): a sample operator written to illustrate JOSDK concepts and its Quarkus extension in the ["Write Kubernetes Operators in Java with the Java Operator SDK" blog series](https://developers.redhat.com/articles/2022/02/15/write-kubernetes-java-java-operator-sdk#). From 1dc866916f5e21c5b9760fa6d97f07f2717d4738 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Fri, 27 Jun 2025 13:21:23 +0200 Subject: [PATCH 19/43] docs: improve wording (#2844) [skip ci] Signed-off-by: Chris Laprun --- docs/content/en/docs/faq/_index.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/content/en/docs/faq/_index.md b/docs/content/en/docs/faq/_index.md index 23a6ea2743..1c3d82fe35 100644 --- a/docs/content/en/docs/faq/_index.md +++ b/docs/content/en/docs/faq/_index.md @@ -97,30 +97,31 @@ Dependent Resources feature supports the [first approach](../documentation/depen ### How can I make the status update of my custom resource trigger a reconciliation? -For the primary resource, the framework by default specially checks if the change on the primary -resource is increased the `generation` field in the metadata, and filters out the related event if not. -This field is increased when `.spec` of the resource is changed. Therefore, a change in the `.status` field -will not trigger a reconciliation. +The framework checks, by default, when an event occurs, that could trigger a reconciliation, if the event increased the +`generation` field of the primary resource's metadata and filters out the event if it did not. `generation` is typically +only increased when the `.spec` field of a resource is changed. As a result, a change in the `.status` field would not +normally trigger a reconciliation. -To change this behavior, you can set the [`generationAwareEventProcessing`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java#L43) +To change this behavior, you can set the [ +`generationAwareEventProcessing`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java#L43) to `false`: ```java + @ControllerConfiguration(generationAwareEventProcessing = false) - static class TestCustomReconciler implements Reconciler { +static class TestCustomReconciler implements Reconciler { @Override public UpdateControl reconcile(TestCustomResource resource, Context context) { // code omitted } - } +} ``` -For secondary resources, every change should trigger a reconciliation by default. -Except when you add explicit filter or use dependent resources that by default filter out own changes, +For secondary resources, every change should trigger a reconciliation by default, except when you add explicit filters +or use dependent resource implementations that filter out changes they trigger themselves by default, see [related docs](../documentation/dependent-resource-and-workflows/dependent-resources.md#caching-and-event-handling-in-kubernetesdependentresource). - ### How can I skip the reconciliation of a dependent resource? Skipping workflow reconciliation altogether is possible with the explicit invocation feature since v5. From afe8e174d4a10cfab323345e310a8677b67fcef6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 08:08:04 +0200 Subject: [PATCH 20/43] chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin (#2846) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.7 to 3.2.8. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.7...maven-gpg-plugin-3.2.8) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-version: 3.2.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- operator-framework-bom/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index ccbb4ca4e2..59d9c7739b 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -42,7 +42,7 @@ 1.7.0 - 3.2.7 + 3.2.8 3.3.1 3.11.2 2.44.3 diff --git a/pom.xml b/pom.xml index 0162bb0849..3338294845 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.3.1 3.4.2 3.5.0 - 3.2.7 + 3.2.8 1.7.0 3.0.0 3.1.4 From 771572c112b6266be1eb38456e94f2d32504461f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 08:07:22 +0200 Subject: [PATCH 21/43] chore(deps): bump org.junit:junit-bom from 5.13.2 to 5.13.3 (#2850) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3338294845..9ea2935eb9 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ java-operator-sdk https://sonarcloud.io jdk - 5.13.2 + 5.13.3 7.3.1 2.0.17 2.25.0 From c44447a63d514c1da3cf996d8aa79e9843c9c1e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 08:08:33 +0200 Subject: [PATCH 22/43] chore(deps): bump io.github.java-diff-utils:java-diff-utils (#2851) Bumps [io.github.java-diff-utils:java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) from 4.15 to 4.16. - [Release notes](https://github.com/java-diff-utils/java-diff-utils/releases) - [Changelog](https://github.com/java-diff-utils/java-diff-utils/blob/master/CHANGELOG.md) - [Commits](https://github.com/java-diff-utils/java-diff-utils/compare/java-diff-utils-parent-4.15...java-diff-utils-parent-4.16) --- updated-dependencies: - dependency-name: io.github.java-diff-utils:java-diff-utils dependency-version: '4.16' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9ea2935eb9..6a783768e5 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.2.1 0.9.14 2.19.0 - 4.15 + 4.16 2.11 3.14.0 From 0bd80e9a5a08653b41b1aa2ded09d53bdce5da47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 08:20:14 +0200 Subject: [PATCH 23/43] chore(deps): bump com.diffplug.spotless:spotless-maven-plugin (#2852) Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.44.5 to 2.45.0. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.5...lib/2.45.0) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-version: 2.45.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a783768e5..fd025f3c63 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 3.1.4 9.0.2 3.4.6 - 2.44.5 + 2.45.0 From 407c4196a5daad7982d8aac6ed74983312d751bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 07:16:05 +0200 Subject: [PATCH 24/43] chore(deps): bump org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0 (#2855) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fd025f3c63..d5572c8028 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 2.0.17 2.25.0 5.18.0 - 3.17.0 + 3.18.0 0.21.0 1.13.0 3.27.3 From 07c9ba99936a5953cc7d61d9d9eed2063fe55554 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:00:08 +0200 Subject: [PATCH 25/43] chore(deps): bump com.github.ben-manes.caffeine:caffeine (#2857) Bumps [com.github.ben-manes.caffeine:caffeine](https://github.com/ben-manes/caffeine) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/ben-manes/caffeine/releases) - [Commits](https://github.com/ben-manes/caffeine/compare/v3.2.1...v3.2.2) --- updated-dependencies: - dependency-name: com.github.ben-manes.caffeine:caffeine dependency-version: 3.2.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d5572c8028..81c760dde1 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 4.3.0 2.7.3 1.15.1 - 3.2.1 + 3.2.2 0.9.14 2.19.0 4.16 From 99e311d55bce30781a8d574edd08d2d5dda99957 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:05:12 +0200 Subject: [PATCH 26/43] chore(deps): bump log4j.version from 2.25.0 to 2.25.1 (#2858) Bumps `log4j.version` from 2.25.0 to 2.25.1. Updates `org.apache.logging.log4j:log4j-slf4j2-impl` from 2.25.0 to 2.25.1 Updates `org.apache.logging.log4j:log4j-core` from 2.25.0 to 2.25.1 Updates `org.apache.logging.log4j:log4j2-core` from 2.25.0 to 2.25.1 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl dependency-version: 2.25.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-core dependency-version: 2.25.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j2-core dependency-version: 2.25.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 81c760dde1..1371df99e5 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 5.13.3 7.3.1 2.0.17 - 2.25.0 + 2.25.1 5.18.0 3.18.0 0.21.0 From dd0fde858b26e05f972f9425ae4d3ab368324bcc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 10:16:15 +0200 Subject: [PATCH 27/43] chore(deps): bump io.micrometer:micrometer-core from 1.15.1 to 1.15.2 (#2859) Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.15.1 to 1.15.2. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.15.1...v1.15.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-version: 1.15.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1371df99e5..8f9a1a5ac3 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 3.27.3 4.3.0 2.7.3 - 1.15.1 + 1.15.2 3.2.2 0.9.14 2.19.0 From 07f99354fa3947a6380f9fb236cca90a4b68b950 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 08:51:43 +0200 Subject: [PATCH 28/43] chore(deps): bump org.apache.maven:maven-plugin-api from 3.9.9 to 3.9.11 (#2860) --- updated-dependencies: - dependency-name: org.apache.maven:maven-plugin-api dependency-version: 3.9.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- bootstrapper-maven-plugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrapper-maven-plugin/pom.xml b/bootstrapper-maven-plugin/pom.xml index eaa32eb009..22a9db1bea 100644 --- a/bootstrapper-maven-plugin/pom.xml +++ b/bootstrapper-maven-plugin/pom.xml @@ -15,7 +15,7 @@ 3.15.1 - 3.9.9 + 3.9.11 3.0.0 3.15.1 From 50a90f1ef6a323c03388d7bf88d280579bb2e973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 15:27:50 +0200 Subject: [PATCH 29/43] improve: release process (#2861) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see details: https://central.sonatype.org/publish/publish-portal-maven/#usage see sample also here: https://github.com/teamlead/java-maven-sonatype-starter/tree/master Signed-off-by: Attila Mészáros --- .github/workflows/release-project-in-dir.yml | 20 ++++++++++-------- .github/workflows/snapshot-releases.yml | 22 ++++++++++++-------- pom.xml | 13 ++++++------ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release-project-in-dir.yml b/.github/workflows/release-project-in-dir.yml index dc79b6f6c2..02280d5a1f 100644 --- a/.github/workflows/release-project-in-dir.yml +++ b/.github/workflows/release-project-in-dir.yml @@ -29,6 +29,11 @@ jobs: java-version: 17 distribution: temurin cache: 'maven' + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Change version to release version # Assume that RELEASE_VERSION will have form like: "v1.0.1". So we cut the "v" @@ -37,15 +42,12 @@ jobs: env: RELEASE_VERSION: ${{ github.event.release.tag_name }} - - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - maven_profiles: "release" - maven_args: ${{ env.MAVEN_ARGS }} - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} - nexus_username: ${{ secrets.OSSRH_USERNAME }} - nexus_password: ${{ secrets.OSSRH_TOKEN }} + - name: Publish to Apache Maven Central + run: mvn package deploy -Prelease + env: + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} # This is separate job because there were issues with git after release step, was not able to commit changes. update-working-version: diff --git a/.github/workflows/snapshot-releases.yml b/.github/workflows/snapshot-releases.yml index 66fe9d25a3..f9219d1278 100644 --- a/.github/workflows/snapshot-releases.yml +++ b/.github/workflows/snapshot-releases.yml @@ -33,14 +33,18 @@ jobs: - name: Set up Java and Maven uses: actions/setup-java@v4 with: - distribution: temurin java-version: 17 + distribution: temurin cache: 'maven' - - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - maven_profiles: "release" - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} - nexus_username: ${{ secrets.OSSRH_USERNAME }} - nexus_password: ${{ secrets.OSSRH_TOKEN }} + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Publish to Apache Maven Central + run: mvn package deploy -Prelease + env: + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/pom.xml b/pom.xml index 8f9a1a5ac3..fe7de8a8a6 100644 --- a/pom.xml +++ b/pom.xml @@ -544,14 +544,15 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging-maven-plugin.version} + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - ossrh - https://oss.sonatype.org/ - true + central + true + true + published From ad2cd4e238224d1d38d8d0d65ac28f4e517be7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 15:47:37 +0200 Subject: [PATCH 30/43] fix: remove snapshot repo override (#2862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pom.xml b/pom.xml index fe7de8a8a6..7cfc62a8b1 100644 --- a/pom.xml +++ b/pom.xml @@ -44,13 +44,6 @@ https://github.com/operator-framework/java-operator-sdk/tree/main - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - UTF-8 17 From 2409b22e1d90fd39c75add24e6d34eb62adaaf99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 17:04:03 +0200 Subject: [PATCH 31/43] fix: remove staging plugin from bom module (#2863) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- operator-framework-bom/pom.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index 59d9c7739b..4000db4f5d 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -131,7 +131,6 @@ org.apache.maven.plugins maven-source-plugin - ${maven-source-plugin.version} attach-sources @@ -144,7 +143,6 @@ org.apache.maven.plugins maven-gpg-plugin - ${maven-gpg-plugin.version} sign-artifacts @@ -162,14 +160,15 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging-maven-plugin.version} + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - ossrh - https://oss.sonatype.org/ - true + central + true + true + published From 34e69ee819e9e1becd2556c8372a05dd73e6d26e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 17:11:27 +0200 Subject: [PATCH 32/43] fix: put back version for bom in release (#2864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- operator-framework-bom/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index 4000db4f5d..fb326beb8f 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -131,6 +131,7 @@ org.apache.maven.plugins maven-source-plugin + ${maven-source-plugin.version} attach-sources @@ -143,6 +144,7 @@ org.apache.maven.plugins maven-gpg-plugin + ${maven-gpg-plugin.version} sign-artifacts From 33594a2e6d158078dc8b45374d152e87c9763513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 17:18:34 +0200 Subject: [PATCH 33/43] fix: source plugin for release (#2865) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- operator-framework-bom/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index fb326beb8f..8bcb72b731 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -136,7 +136,7 @@ attach-sources - jar + jar-no-fork diff --git a/pom.xml b/pom.xml index 7cfc62a8b1..ce4684e70e 100644 --- a/pom.xml +++ b/pom.xml @@ -512,7 +512,7 @@ attach-sources - jar + jar-no-fork From 8f93270d2d925e97f15fb0a937132a3c773d3daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 17:27:07 +0200 Subject: [PATCH 34/43] fix: remove source plugin from bom release (#2866) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- operator-framework-bom/pom.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index 8bcb72b731..df6ad6d2b3 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -128,19 +128,6 @@ - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin.version} - - - attach-sources - - jar-no-fork - - - - org.apache.maven.plugins maven-gpg-plugin From 12b1711088866eb9fe9c43215608e3136714426e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Wed, 16 Jul 2025 17:42:03 +0200 Subject: [PATCH 35/43] fix: temp removing bom release (#2867) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- operator-framework-bom/pom.xml | 55 ---------------------------------- 1 file changed, 55 deletions(-) diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index df6ad6d2b3..7b1ab64069 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -109,59 +109,4 @@ - - - - release - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${maven-gpg-plugin.version} - - - sign-artifacts - - sign - - verify - - - --pinentry-mode - loopback - - - - - - - org.sonatype.central - central-publishing-maven-plugin - 0.8.0 - true - - central - true - true - published - - - - - - From a6c34e550447c9c7280b07813d7f5de0f436816a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 21 Jul 2025 13:13:32 +0200 Subject: [PATCH 36/43] fix: release and snapshot release (#2873) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tested locally Signed-off-by: Attila Mészáros --- operator-framework-bom/pom.xml | 88 ++++++++++++++++++++++++++++++---- pom.xml | 20 ++++---- 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml index 7b1ab64069..fad8f0e164 100644 --- a/operator-framework-bom/pom.xml +++ b/operator-framework-bom/pom.xml @@ -33,19 +33,12 @@ https://github.com/operator-framework/java-operator-sdk/tree/master - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - - 1.7.0 3.2.8 3.3.1 3.11.2 2.44.3 + 0.8.0 @@ -109,4 +102,83 @@ + + + + release + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*IT.java + **/*E2E.java + **/InformerRelatedBehaviorTest.java + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + attach-sources + + jar + + verify + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + + sign + + verify + + + --pinentry-mode + loopback + + + + + + + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-maven-plugin.version} + true + + central + true + true + published + + + + + + diff --git a/pom.xml b/pom.xml index ce4684e70e..4cd8f597fd 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,7 @@ 2.11 3.14.0 3.5.3 + 0.8.0 3.11.2 3.3.1 3.3.1 @@ -286,6 +287,15 @@ org.apache.maven.plugins maven-source-plugin ${maven-source-plugin.version} + + + attach-sources + + jar + + verify + + org.apache.maven.plugins @@ -508,14 +518,6 @@ org.apache.maven.plugins maven-source-plugin - - - attach-sources - - jar-no-fork - - - org.apache.maven.plugins @@ -539,7 +541,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.8.0 + ${central-publishing-maven-plugin.version} true central From 1971fbb17027a9e9ee6c65b23aa5b666764e8529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 21 Jul 2025 17:17:15 +0200 Subject: [PATCH 37/43] fix: minikube setup does not use github token (#2874) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .github/workflows/build.yml | 5 ++++- .github/workflows/e2e-test.yml | 9 ++++++--- .github/workflows/integration-tests.yml | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b81fa41b6d..25562aa1c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,10 @@ jobs: strategy: matrix: java: [ 17, 21, 24 ] - kubernetes: [ '1.30.12', '1.31.8', '1.32.4','1.33.0' ] + # Use the latest versions supported by minikube, otherwise GitHub it will + # end up in a throttling requests from minikube and workflow will fail. + # Minikube does such requests only if a version is not officially supported. + kubernetes: [ '1.30.12', '1.31.8', '1.32.4','1.33.1' ] uses: ./.github/workflows/integration-tests.yml with: java-version: ${{ matrix.java }} diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index e06b427960..408e694a4c 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -1,6 +1,6 @@ # Integration and end to end tests which runs locally and deploys the Operator to a Kubernetes # (Minikube) cluster and creates custom resources to verify the operator's functionality -name: Integration & End to End tests +name: End to End tests on: pull_request: paths-ignore: @@ -32,8 +32,11 @@ jobs: - name: Setup Minikube-Kubernetes uses: manusa/actions-setup-minikube@v2.14.0 with: - minikube version: v1.34.0 - kubernetes version: v1.33.0 + minikube version: v1.36.0 + # Use the latest versions supported by minikube, otherwise GitHub it will + # end up in a throttling requests from minikube and workflow will fail. + # Minikube does such requests only if a version is not officially supported. + kubernetes version: v1.33.1 github token: ${{ secrets.GITHUB_TOKEN }} driver: docker diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 75a6093371..614624242a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -41,10 +41,10 @@ jobs: - name: Set up Minikube uses: manusa/actions-setup-minikube@v2.14.0 with: - minikube version: 'v1.34.0' + minikube version: 'v1.36.0' kubernetes version: '${{ inputs.kube-version }}' - driver: 'docker' - github token: ${{ secrets.GITHUB_TOKEN }} + github token: ${{ github.token }} + - name: "${{inputs.it-category}} integration tests (kube: ${{ inputs.kube-version }} / java: ${{ inputs.java-version }} / client: ${{ inputs.http-client }})" run: | if [ -z "${{inputs.it-category}}" ]; then From b0663eeedcdb632f5af944d8b30a3117583affbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 17:51:19 +0200 Subject: [PATCH 38/43] chore(deps): bump com.diffplug.spotless:spotless-maven-plugin (#2871) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-version: 2.46.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Attila Mészáros --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4cd8f597fd..e5c2c29c5a 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.1.4 9.0.2 3.4.6 - 2.45.0 + 2.46.0 From 33c59ae020714f5395585972fcb985cc04c1bf19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:00:23 +0200 Subject: [PATCH 39/43] chore(deps): bump commons-io:commons-io from 2.19.0 to 2.20.0 (#2872) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-version: 2.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Attila Mészáros --- bootstrapper-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrapper-maven-plugin/pom.xml b/bootstrapper-maven-plugin/pom.xml index 22a9db1bea..742c47adc9 100644 --- a/bootstrapper-maven-plugin/pom.xml +++ b/bootstrapper-maven-plugin/pom.xml @@ -58,7 +58,7 @@ commons-io commons-io - 2.19.0 + 2.20.0 com.github.spullara.mustache.java diff --git a/pom.xml b/pom.xml index e5c2c29c5a..a888d4f9df 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 1.15.2 3.2.2 0.9.14 - 2.19.0 + 2.20.0 4.16 2.11 From 7906bcb319afb0a3f985eec1d74bcfea2e615402 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 08:57:52 +0200 Subject: [PATCH 40/43] chore(deps): bump com.diffplug.spotless:spotless-maven-plugin (#2877) Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.46.0 to 2.46.1. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.46.0...maven/2.46.1) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-version: 2.46.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a888d4f9df..d2a6d00eca 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.1.4 9.0.2 3.4.6 - 2.46.0 + 2.46.1 From 28e18f7d27a23a5943b0abb429b7ae77b47c577c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 08:58:00 +0200 Subject: [PATCH 41/43] chore(deps): bump org.junit:junit-bom from 5.13.3 to 5.13.4 (#2878) Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 5.13.3 to 5.13.4. - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.3...r5.13.4) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 5.13.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d2a6d00eca..88283de27c 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ java-operator-sdk https://sonarcloud.io jdk - 5.13.3 + 5.13.4 7.3.1 2.0.17 2.25.1 From 457c23ffaac7954db0b148f450e9b0ca3d6ce9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Tue, 5 Aug 2025 13:51:14 +0200 Subject: [PATCH 42/43] fix: startup all resource indexing (#2881) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../source/informer/InformerEventSource.java | 10 ++- .../informer/InformerEventSourceTest.java | 7 +- .../junit/AbstractOperatorExtension.java | 4 + .../junit/LocallyRunOperatorExtension.java | 22 +++++- .../StartupSecondaryAccessCustomResource.java | 13 ++++ .../StartupSecondaryAccessIT.java | 53 +++++++++++++ .../StartupSecondaryAccessReconciler.java | 75 +++++++++++++++++++ 7 files changed, 180 insertions(+), 4 deletions(-) create mode 100644 operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessCustomResource.java create mode 100644 operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessIT.java create mode 100644 operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessReconciler.java diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java index b52dc278f2..c029a54170 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java @@ -95,7 +95,7 @@ private InformerEventSource( parseResourceVersions); // If there is a primary to secondary mapper there is no need for primary to secondary index. primaryToSecondaryMapper = configuration.getPrimaryToSecondaryMapper(); - if (primaryToSecondaryMapper == null) { + if (useSecondaryToPrimaryIndex()) { primaryToSecondaryIndex = // The index uses the secondary to primary mapper (always present) to build the index new DefaultPrimaryToSecondaryIndex<>(configuration.getSecondaryToPrimaryMapper()); @@ -157,6 +157,14 @@ public void onDelete(R resource, boolean b) { } } + @Override + public synchronized void start() { + super.start(); + // this makes sure that on first reconciliation all resources are + // present on the index + manager().list().forEach(primaryToSecondaryIndex::onAddOrUpdate); + } + private synchronized void onAddOrUpdate( Operation operation, R newObject, R oldObject, Runnable superOnOp) { var resourceID = ResourceID.fromResource(newObject); diff --git a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSourceTest.java b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSourceTest.java index 3205bca523..a08989c8ce 100644 --- a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSourceTest.java +++ b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSourceTest.java @@ -57,7 +57,12 @@ void setup() { .thenReturn(mock(SecondaryToPrimaryMapper.class)); when(informerEventSourceConfiguration.getResourceClass()).thenReturn(Deployment.class); - informerEventSource = new InformerEventSource<>(informerEventSourceConfiguration, clientMock); + informerEventSource = + new InformerEventSource<>(informerEventSourceConfiguration, clientMock) { + // mocking start + @Override + public synchronized void start() {} + }; var mockControllerConfig = mock(ControllerConfiguration.class); when(mockControllerConfig.getConfigurationService()).thenReturn(new BaseConfigurationService()); diff --git a/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/AbstractOperatorExtension.java b/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/AbstractOperatorExtension.java index 00bf7e8380..794bc11d9a 100644 --- a/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/AbstractOperatorExtension.java +++ b/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/AbstractOperatorExtension.java @@ -111,6 +111,10 @@ public T create(T resource) { return kubernetesClient.resource(resource).inNamespace(namespace).create(); } + public T serverSideApply(T resource) { + return kubernetesClient.resource(resource).inNamespace(namespace).serverSideApply(); + } + public T replace(T resource) { return kubernetesClient.resource(resource).inNamespace(namespace).replace(); } diff --git a/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/LocallyRunOperatorExtension.java b/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/LocallyRunOperatorExtension.java index 3e6ad35e52..54cb57544d 100644 --- a/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/LocallyRunOperatorExtension.java +++ b/operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/LocallyRunOperatorExtension.java @@ -54,6 +54,7 @@ public class LocallyRunOperatorExtension extends AbstractOperatorExtension { private final List> additionalCustomResourceDefinitions; private final Map registeredControllers; private final Map crdMappings; + private final Consumer beforeStartHook; private LocallyRunOperatorExtension( List reconcilers, @@ -68,7 +69,8 @@ private LocallyRunOperatorExtension( Consumer configurationServiceOverrider, Function namespaceNameSupplier, Function perClassNamespaceNameSupplier, - List additionalCrds) { + List additionalCrds, + Consumer beforeStartHook) { super( infrastructure, infrastructureTimeout, @@ -82,6 +84,7 @@ private LocallyRunOperatorExtension( this.portForwards = portForwards; this.localPortForwards = new ArrayList<>(portForwards.size()); this.additionalCustomResourceDefinitions = additionalCustomResourceDefinitions; + this.beforeStartHook = beforeStartHook; configurationServiceOverrider = configurationServiceOverrider != null ? configurationServiceOverrider.andThen( @@ -298,6 +301,10 @@ protected void before(ExtensionContext context) { }); crdMappings.clear(); + if (beforeStartHook != null) { + beforeStartHook.accept(this); + } + LOGGER.debug("Starting the operator locally"); this.operator.start(); } @@ -356,6 +363,7 @@ public static class Builder extends AbstractBuilder { private final List portForwards; private final List> additionalCustomResourceDefinitions; private final List additionalCRDs = new ArrayList<>(); + private Consumer beforeStartHook; private KubernetesClient kubernetesClient; protected Builder() { @@ -424,6 +432,15 @@ public Builder withAdditionalCRD(String... paths) { return this; } + /** + * Used to initialize resources when the namespace is generated but the operator is not started + * yet. + */ + public Builder withBeforeStartHook(Consumer beforeStartHook) { + this.beforeStartHook = beforeStartHook; + return this; + } + public LocallyRunOperatorExtension build() { return new LocallyRunOperatorExtension( reconcilers, @@ -438,7 +455,8 @@ public LocallyRunOperatorExtension build() { configurationServiceOverrider, namespaceNameSupplier, perClassNamespaceNameSupplier, - additionalCRDs); + additionalCRDs, + beforeStartHook); } } diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessCustomResource.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessCustomResource.java new file mode 100644 index 0000000000..b9701c94bd --- /dev/null +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessCustomResource.java @@ -0,0 +1,13 @@ +package io.javaoperatorsdk.operator.baseapi.startsecondaryaccess; + +import io.fabric8.kubernetes.api.model.Namespaced; +import io.fabric8.kubernetes.client.CustomResource; +import io.fabric8.kubernetes.model.annotation.Group; +import io.fabric8.kubernetes.model.annotation.ShortNames; +import io.fabric8.kubernetes.model.annotation.Version; + +@Group("sample.javaoperatorsdk") +@Version("v1") +@ShortNames("ssac") +public class StartupSecondaryAccessCustomResource extends CustomResource + implements Namespaced {} diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessIT.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessIT.java new file mode 100644 index 0000000000..61fc40803c --- /dev/null +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessIT.java @@ -0,0 +1,53 @@ +package io.javaoperatorsdk.operator.baseapi.startsecondaryaccess; + +import java.util.Map; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.fabric8.kubernetes.api.model.ConfigMap; +import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; +import io.javaoperatorsdk.operator.junit.LocallyRunOperatorExtension; + +import static io.javaoperatorsdk.operator.baseapi.startsecondaryaccess.StartupSecondaryAccessReconciler.LABEL_KEY; +import static io.javaoperatorsdk.operator.baseapi.startsecondaryaccess.StartupSecondaryAccessReconciler.LABEL_VALUE; +import static org.assertj.core.api.Assertions.assertThat; +import static org.awaitility.Awaitility.await; + +class StartupSecondaryAccessIT { + + public static final int SECONDARY_NUMBER = 200; + + @RegisterExtension + static LocallyRunOperatorExtension extension = + LocallyRunOperatorExtension.builder() + .withReconciler(new StartupSecondaryAccessReconciler()) + .withBeforeStartHook( + ex -> { + var primary = new StartupSecondaryAccessCustomResource(); + primary.setMetadata(new ObjectMetaBuilder().withName("test1").build()); + primary = ex.serverSideApply(primary); + + for (int i = 0; i < SECONDARY_NUMBER; i++) { + ConfigMap cm = new ConfigMap(); + cm.setMetadata( + new ObjectMetaBuilder() + .withLabels(Map.of(LABEL_KEY, LABEL_VALUE)) + .withNamespace(ex.getNamespace()) + .withName("cm" + i) + .build()); + cm.addOwnerReference(primary); + ex.serverSideApply(cm); + } + }) + .build(); + + @Test + void reconcilerSeeAllSecondaryResources() { + var reconciler = extension.getReconcilerOfType(StartupSecondaryAccessReconciler.class); + + await().untilAsserted(() -> assertThat(reconciler.isReconciled()).isTrue()); + + assertThat(reconciler.isSecondaryAndCacheSameAmount()).isTrue(); + } +} diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessReconciler.java new file mode 100644 index 0000000000..a2c51fdafd --- /dev/null +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessReconciler.java @@ -0,0 +1,75 @@ +package io.javaoperatorsdk.operator.baseapi.startsecondaryaccess; + +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.fabric8.kubernetes.api.model.ConfigMap; +import io.javaoperatorsdk.operator.api.config.informer.InformerEventSourceConfiguration; +import io.javaoperatorsdk.operator.api.reconciler.Context; +import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration; +import io.javaoperatorsdk.operator.api.reconciler.EventSourceContext; +import io.javaoperatorsdk.operator.api.reconciler.Reconciler; +import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; +import io.javaoperatorsdk.operator.processing.event.source.EventSource; +import io.javaoperatorsdk.operator.processing.event.source.informer.InformerEventSource; + +import static io.javaoperatorsdk.operator.baseapi.startsecondaryaccess.StartupSecondaryAccessIT.SECONDARY_NUMBER; + +@ControllerConfiguration +public class StartupSecondaryAccessReconciler + implements Reconciler { + + private static final Logger log = LoggerFactory.getLogger(StartupSecondaryAccessReconciler.class); + + public static final String LABEL_KEY = "app"; + public static final String LABEL_VALUE = "secondary-test"; + + private InformerEventSource cmInformer; + + private boolean secondaryAndCacheSameAmount = true; + private boolean reconciled = false; + + @Override + public UpdateControl reconcile( + StartupSecondaryAccessCustomResource resource, + Context context) { + + var secondary = context.getSecondaryResources(ConfigMap.class); + var cached = cmInformer.list().toList(); + + log.info( + "Secondary number: {}, cached: {}, expected: {}", + secondary.size(), + cached.size(), + SECONDARY_NUMBER); + + if (secondary.size() != cached.size()) { + secondaryAndCacheSameAmount = false; + } + reconciled = true; + return UpdateControl.noUpdate(); + } + + @Override + public List> prepareEventSources( + EventSourceContext context) { + cmInformer = + new InformerEventSource<>( + InformerEventSourceConfiguration.from( + ConfigMap.class, StartupSecondaryAccessCustomResource.class) + .withLabelSelector(LABEL_KEY + "=" + LABEL_VALUE) + .build(), + context); + return List.of(cmInformer); + } + + public boolean isSecondaryAndCacheSameAmount() { + return secondaryAndCacheSameAmount; + } + + public boolean isReconciled() { + return reconciled; + } +} From a94297054ed80a3a58e4da8ce16fe079e3ea90b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Tue, 5 Aug 2025 13:51:58 +0200 Subject: [PATCH 43/43] improve: DependentResourceCrossRefIT cleanup and logging (#2883) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../DependentResourceCrossRefIT.java | 16 ++++++++++++++++ .../DependentResourceCrossRefReconciler.java | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefIT.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefIT.java index ae5cd25895..1b71c79448 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefIT.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefIT.java @@ -44,6 +44,22 @@ void dependentResourceCanReferenceEachOther() { assertThat(operator.get(Secret.class, TEST_RESOURCE_NAME + i)).isNotNull(); } }); + + for (int i = 0; i < EXECUTION_NUMBER; i++) { + operator.delete(testResource(i)); + } + await() + .timeout(Duration.ofSeconds(30)) + .untilAsserted( + () -> { + for (int i = 0; i < EXECUTION_NUMBER; i++) { + assertThat( + operator.get( + DependentResourceCrossRefResource.class, + testResource(i).getMetadata().getName())) + .isNull(); + } + }); } DependentResourceCrossRefResource testResource(int n) { diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefReconciler.java index 5d54ecdabe..247174838c 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefReconciler.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/dependentresourcecrossref/DependentResourceCrossRefReconciler.java @@ -5,6 +5,9 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import io.fabric8.kubernetes.api.model.ConfigMap; import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; import io.fabric8.kubernetes.api.model.Secret; @@ -26,6 +29,8 @@ @ControllerConfiguration public class DependentResourceCrossRefReconciler implements Reconciler { + private static final Logger log = + LoggerFactory.getLogger(DependentResourceCrossRefReconciler.class); public static final String SECRET_NAME = "secret"; private final AtomicInteger numberOfExecutions = new AtomicInteger(0); @@ -48,6 +53,7 @@ public ErrorStatusUpdateControl updateErrorSt DependentResourceCrossRefResource resource, Context context, Exception e) { + log.error("Status update on error", e); errorHappened = true; return ErrorStatusUpdateControl.noStatusUpdate(); }