expectedType, String eventS
* If a workflow has an activation condition there can be event sources which are only
* registered if the activation condition holds, but to provide a consistent API we return an
* Optional instead of throwing an exception.
- *
+ *
* Note that not only the resource which has an activation condition might not be registered
* but dependents which depend on it.
*/
@@ -116,4 +116,8 @@ public DefaultContext setRetryInfo(RetryInfo retryInfo) {
this.retryInfo = retryInfo;
return this;
}
+
+ public P getPrimaryResource() {
+ return primaryResource;
+ }
}
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java
index 1ad3b65910..8c502d41ff 100644
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java
+++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java
@@ -86,7 +86,7 @@ private PostExecutionControl
handleDispatch(ExecutionScope
executionScope)
}
Context
context =
- new DefaultContext<>(executionScope.getRetryInfo(), controller, originalResource);
+ new DefaultContext<>(executionScope.getRetryInfo(), controller, resourceForExecution);
if (markedForDeletion) {
return handleCleanup(resourceForExecution, originalResource, context);
} else {
@@ -234,29 +234,29 @@ private void updatePostExecutionControlWithReschedule(
baseControl.getScheduleDelay().ifPresent(postExecutionControl::withReSchedule);
}
- private PostExecutionControl
handleCleanup(P resource,
+ private PostExecutionControl
handleCleanup(P resourceForExecution,
P originalResource, Context
context) {
if (log.isDebugEnabled()) {
log.debug(
"Executing delete for resource: {} with version: {}",
- ResourceID.fromResource(resource),
- getVersion(resource));
+ ResourceID.fromResource(resourceForExecution),
+ getVersion(resourceForExecution));
}
- DeleteControl deleteControl = controller.cleanup(resource, context);
+ DeleteControl deleteControl = controller.cleanup(resourceForExecution, context);
final var useFinalizer = controller.useFinalizer();
if (useFinalizer) {
// note that we don't reschedule here even if instructed. Removing finalizer means that
- // cleanup is finished, nothing left to done
+ // cleanup is finished, nothing left to be done
final var finalizerName = configuration().getFinalizerName();
- if (deleteControl.isRemoveFinalizer() && resource.hasFinalizer(finalizerName)) {
- P customResource = conflictRetryingPatch(resource, originalResource, r -> {
+ if (deleteControl.isRemoveFinalizer() && resourceForExecution.hasFinalizer(finalizerName)) {
+ P customResource = conflictRetryingPatch(resourceForExecution, originalResource, r -> {
// the operator might not be allowed to retrieve the resource on a retry, e.g. when its
// permissions are removed by deleting the namespace concurrently
if (r == null) {
log.warn(
"Could not remove finalizer on null resource: {} with version: {}",
- getUID(resource),
- getVersion(resource));
+ getUID(resourceForExecution),
+ getVersion(resourceForExecution));
return false;
}
return r.removeFinalizer(finalizerName);
@@ -266,8 +266,8 @@ private PostExecutionControl
handleCleanup(P resource,
}
log.debug(
"Skipping finalizer remove for resource: {} with version: {}. delete control: {}, uses finalizer: {}",
- getUID(resource),
- getVersion(resource),
+ getUID(resourceForExecution),
+ getVersion(resourceForExecution),
deleteControl,
useFinalizer);
PostExecutionControl
postExecutionControl = PostExecutionControl.defaultDispatch();
diff --git a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java
index efec8c4228..e5fe1c5882 100644
--- a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java
+++ b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java
@@ -7,6 +7,8 @@
import java.util.function.BiFunction;
import java.util.function.Supplier;
+import io.fabric8.kubernetes.client.utils.KubernetesSerialization;
+import io.javaoperatorsdk.operator.api.reconciler.DefaultContext;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
@@ -68,6 +70,9 @@ void setup() {
}
static void initConfigService(boolean useSSA) {
+ initConfigService(useSSA,true);
+ }
+ static void initConfigService(boolean useSSA, boolean noCloning) {
/*
* We need this for mock reconcilers to properly generate the expected UpdateControl: without
* this, calls such as `when(reconciler.reconcile(eq(testCustomResource),
@@ -77,14 +82,18 @@ static void initConfigService(boolean useSSA) {
*/
configurationService =
ConfigurationService.newOverriddenConfigurationService(new BaseConfigurationService(),
- overrider -> overrider.checkingCRDAndValidateLocalModel(false)
+ overrider -> overrider.checkingCRDAndValidateLocalModel(false)
+
.withResourceCloner(new Cloner() {
@Override
public R clone(R object) {
+ if (noCloning) {
return object;
+ }else {
+ return new KubernetesSerialization().clone(object);
}
- })
- .withUseSSAToPatchPrimaryResource(useSSA));
+ }})
+ .withUseSSAToPatchPrimaryResource(useSSA));
}
private ReconciliationDispatcher init(R customResource,
@@ -659,10 +668,24 @@ void reSchedulesFromErrorHandler() {
}
@Test
- void addsFinalizerToPatchWithSSA() {
+ void reconcilerContextUsesTheSameInstanceOfResourceAsParam() {
+ initConfigService(false,false);
- }
+ final ReconciliationDispatcher dispatcher =
+ init(testCustomResource, reconciler, null, customResourceFacade, true);
+ testCustomResource.addFinalizer(DEFAULT_FINALIZER);
+ ArgumentCaptor contextArgumentCaptor = ArgumentCaptor.forClass(DefaultContext.class);
+ ArgumentCaptor customResourceCaptor = ArgumentCaptor.forClass(TestCustomResource.class);
+
+ dispatcher.handleExecution(executionScopeWithCREvent(testCustomResource));
+ verify(reconciler, times(1))
+ .reconcile(customResourceCaptor.capture(), contextArgumentCaptor.capture());
+
+ assertThat(contextArgumentCaptor.getValue().getPrimaryResource())
+ .isSameAs(customResourceCaptor.getValue())
+ .isNotSameAs(testCustomResource);
+ }
private ObservedGenCustomResource createObservedGenCustomResource() {
ObservedGenCustomResource observedGenCustomResource = new ObservedGenCustomResource();
From 8bdc402ed7c8390cb227ba59e8b7a53770ce44b7 Mon Sep 17 00:00:00 2001
From: Martin Stefanko
Date: Mon, 17 Feb 2025 16:15:31 +0100
Subject: [PATCH 022/206] fix: allow keeping deleted CRDs in test with
configuration (#2687)
Signed-off-by: xstefank
---
.../junit/LocallyRunOperatorExtension.java | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
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 241c59371d..45cd85b468 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
@@ -8,11 +8,16 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
+import java.util.ArrayDeque;
import java.util.ArrayList;
+import java.util.Deque;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Stream;
@@ -43,6 +48,8 @@ public class LocallyRunOperatorExtension extends AbstractOperatorExtension {
private static final Logger LOGGER = LoggerFactory.getLogger(LocallyRunOperatorExtension.class);
private static final int CRD_DELETE_TIMEOUT = 1000;
+ private static final Set appliedCRDs = new HashSet<>();
+ private static final boolean deleteCRDs = Boolean.parseBoolean(System.getProperty("testsuite.deleteCRDs", "true"));
private final Operator operator;
private final List reconcilers;
@@ -51,7 +58,6 @@ public class LocallyRunOperatorExtension extends AbstractOperatorExtension {
private final List> additionalCustomResourceDefinitions;
private final Map registeredControllers;
private final Map crdMappings;
- private static final LinkedList appliedCRDs = new LinkedList<>();
private LocallyRunOperatorExtension(
List reconcilers,
@@ -297,8 +303,10 @@ protected void after(ExtensionContext context) {
var kubernetesClient = getKubernetesClient();
- while (!appliedCRDs.isEmpty()) {
- deleteCrd(appliedCRDs.poll(), kubernetesClient);
+ var iterator = appliedCRDs.iterator();
+ while (iterator.hasNext()) {
+ deleteCrd(iterator.next(), kubernetesClient);
+ iterator.remove();
}
kubernetesClient.close();
@@ -320,6 +328,10 @@ protected void after(ExtensionContext context) {
}
private void deleteCrd(AppliedCRD appliedCRD, KubernetesClient client) {
+ if (!deleteCRDs) {
+ LOGGER.debug("Skipping deleting CRD because of configuration: {}", appliedCRD);
+ return;
+ }
try {
LOGGER.debug("Deleting CRD: {}", appliedCRD.crdString);
final var crd = client.load(new ByteArrayInputStream(appliedCRD.crdString.getBytes()));
From 1c87f5f9ee83af4e11048d9d7a392414859fb488 Mon Sep 17 00:00:00 2001
From: Martin Stefanko
Date: Wed, 19 Feb 2025 15:49:49 +0100
Subject: [PATCH 023/206] chore: update OWNERS for the current state of the
project (#2690)
Signed-off-by: xstefank
---
OWNERS | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/OWNERS b/OWNERS
index f227f81a1d..3a63d7d7d0 100644
--- a/OWNERS
+++ b/OWNERS
@@ -2,8 +2,12 @@ approvers:
- csviri
- metacosm
- andreaTP
+- xstefank
reviewers:
- gyfora
- mbalassi
-- adam-sandor
- scrocquesel
+- csviri
+- metacosm
+- xstefank
+
From 0dd72b5f6e4fb1a2acc23022605f9af90d6249a1 Mon Sep 17 00:00:00 2001
From: GitHub Action
Date: Wed, 19 Feb 2025 16:44:51 +0000
Subject: [PATCH 024/206] 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 725b904c9f..5756037cd8 100644
--- a/bootstrapper-maven-plugin/pom.xml
+++ b/bootstrapper-maven-plugin/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
bootstrapper
diff --git a/caffeine-bounded-cache-support/pom.xml b/caffeine-bounded-cache-support/pom.xml
index 1696a57e37..ce51895803 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.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
caffeine-bounded-cache-support
diff --git a/micrometer-support/pom.xml b/micrometer-support/pom.xml
index 1cfd506336..d39a5fad8f 100644
--- a/micrometer-support/pom.xml
+++ b/micrometer-support/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
micrometer-support
diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml
index bf598ef822..9874f8ce76 100644
--- a/operator-framework-bom/pom.xml
+++ b/operator-framework-bom/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
operator-framework-bom
- 5.0.2-SNAPSHOT
+ 5.0.3-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 d18f46d0f5..61e7d71e4c 100644
--- a/operator-framework-core/pom.xml
+++ b/operator-framework-core/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
../pom.xml
diff --git a/operator-framework-junit5/pom.xml b/operator-framework-junit5/pom.xml
index 465bbc0d20..dd319d954b 100644
--- a/operator-framework-junit5/pom.xml
+++ b/operator-framework-junit5/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
operator-framework-junit-5
diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml
index 1f505fae78..a9ff8d2334 100644
--- a/operator-framework/pom.xml
+++ b/operator-framework/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
operator-framework
diff --git a/pom.xml b/pom.xml
index 3d894384b2..b1d9c1c6eb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.2-SNAPSHOT
+ 5.0.3-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 c5f6e7abc3..133a745ddb 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.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
sample-controller-namespace-deletion
diff --git a/sample-operators/leader-election/pom.xml b/sample-operators/leader-election/pom.xml
index 42b54bf5be..4002f98450 100644
--- a/sample-operators/leader-election/pom.xml
+++ b/sample-operators/leader-election/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
sample-leader-election
diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml
index ecd3398a76..9e91548801 100644
--- a/sample-operators/mysql-schema/pom.xml
+++ b/sample-operators/mysql-schema/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
sample-mysql-schema-operator
diff --git a/sample-operators/pom.xml b/sample-operators/pom.xml
index 7b13dc5d7e..8aa9a53fce 100644
--- a/sample-operators/pom.xml
+++ b/sample-operators/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
sample-operators
diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml
index 9a126f5995..dac3246700 100644
--- a/sample-operators/tomcat-operator/pom.xml
+++ b/sample-operators/tomcat-operator/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
sample-tomcat-operator
diff --git a/sample-operators/webpage/pom.xml b/sample-operators/webpage/pom.xml
index 5128cf0d0f..192853edc3 100644
--- a/sample-operators/webpage/pom.xml
+++ b/sample-operators/webpage/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.2-SNAPSHOT
+ 5.0.3-SNAPSHOT
sample-webpage-operator
From 8a37956aa68c8db2df35d26aa28bbfdd75d769a8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 21 Feb 2025 16:52:21 +0100
Subject: [PATCH 025/206] chore(deps): bump
org.apache.maven.plugins:maven-clean-plugin (#2692)
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index b1d9c1c6eb..25d6bb558b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,7 @@
3.3.1
3.3.1
3.4.2
- 3.4.0
+ 3.4.1
3.2.7
1.7.0
3.0.0
From 0b47463af54ce98d65d9897947e3d97abfe2ceea Mon Sep 17 00:00:00 2001
From: Martin Stefanko
Date: Sat, 22 Feb 2025 12:10:49 +0100
Subject: [PATCH 026/206] refactor: CI only pulls each minikube once for each
kubernetes version (#2691)
Signed-off-by: xstefank
---
.github/workflows/build.yml | 54 ++++++++++++++++++++++---
.github/workflows/integration-tests.yml | 20 +++++----
.github/workflows/pr.yml | 8 +++-
3 files changed, 69 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a1e813a075..97555ae1b5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,39 +1,73 @@
-name: Build
+name: Build with Kubernetes
env:
MAVEN_ARGS: -V -ntp -e
on:
workflow_call:
+ inputs:
+ kube-version:
+ type: string
+ required: true
jobs:
+ set_up_kubernetes:
+ name: Set up Kubernetes ${{ inputs.kube-version }}
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Minikube
+ uses: manusa/actions-setup-minikube@v2.13.1
+ with:
+ minikube version: 'v1.34.0'
+ kubernetes version: '${{ inputs.kube-version }}'
+ driver: 'docker'
+ github token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Save minikube directory
+ id: minikube
+ run: |
+ echo "minikube-dir=$MINIKUBE_HOME" >> $GITHUB_OUTPUT
+
+ - name: Upload minikube
+ uses: actions/upload-artifact@v4
+ with:
+ name: minikube-${{ inputs.kube-version }}
+ path: ${{ steps.minikube.outputs.minikube-dir }}
+ include-hidden-files: true
+
integration_tests:
+ name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}"
+ needs: set_up_kubernetes
strategy:
matrix:
java: [ 17, 21 ]
- kubernetes: [ 'v1.29.12','1.30.8', '1.31.4', '1.32.0' ]
it-category: [ 'baseapi', 'dependent', 'workflow' ]
uses: ./.github/workflows/integration-tests.yml
with:
+ kube-version: ${{ inputs.kube-version }}
java-version: ${{ matrix.java }}
- kube-version: ${{ matrix.kubernetes }}
it-category: ${{ matrix.it-category }}
http_client_tests:
+ name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}, HTTP client: ${{ matrix.httpclient }}"
+ needs: set_up_kubernetes
strategy:
matrix:
java: [ 17, 21 ]
- kubernetes: [ 'v1.29.12','1.30.8', '1.31.4', '1.32.0' ]
it-category: [ 'baseapi' ]
httpclient: [ 'vertx', 'jdk', 'jetty' ]
uses: ./.github/workflows/integration-tests.yml
with:
+ kube-version: ${{ inputs.kube-version }}
java-version: ${{ matrix.java }}
- kube-version: ${{ matrix.kubernetes }}
it-category: ${{ matrix.it-category }}
http-client: ${{ matrix.httpclient }}
special_integration_tests:
+ name: "Special integration tests (${{ matrix.java }})"
+ needs: set_up_kubernetes
runs-on: ubuntu-latest
strategy:
matrix:
@@ -47,3 +81,13 @@ jobs:
java-version: ${{ matrix.java }}
- name: Run Special Integration Tests
run: ./mvnw ${MAVEN_ARGS} -B package -P minimal-watch-timeout-dependent-it --file pom.xml
+
+ delete_kubernetes:
+ needs: [ integration_tests, http_client_tests, special_integration_tests ]
+ if: always()
+ name: Delete Kubernetes ${{ inputs.kube-version }} artifact
+ runs-on: ubuntu-latest
+ steps:
+ - uses: geekyeggo/delete-artifact@v5
+ with:
+ name: minikube-${{ inputs.kube-version }}
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index a40c9c8b9a..dff59bfe7c 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -28,6 +28,7 @@ on:
jobs:
integration_tests:
+ name: "Experimental: ${{ inputs.experimental }}, Checkout ref: ${{ inputs.checkout-ref }}"
runs-on: ubuntu-latest
continue-on-error: ${{ inputs.experimental }}
timeout-minutes: 40
@@ -43,13 +44,18 @@ jobs:
distribution: temurin
java-version: ${{ inputs.java-version }}
cache: 'maven'
- - name: Set up Minikube
- uses: manusa/actions-setup-minikube@v2.13.1
+ - name: Download minikube artifact for Kubernetes ${{ inputs.kube-version }}
+ uses: actions/download-artifact@v4
with:
- minikube version: 'v1.34.0'
- kubernetes version: '${{ inputs.kube-version }}'
- driver: 'docker'
- github token: ${{ secrets.GITHUB_TOKEN }}
+ name: minikube-${{inputs.kube-version}}
+ path: minikube
+ - name: Start minikube with Kubernetes ${{ inputs.kube-version }}
+ run: |
+ # wait for docker
+ docker version -f '{{.Server.Version}} - {{.Client.Version}}'
+ export MINIKUBE_HOME=$PWD/minikube
+ minikube start --driver=docker
+ kubectl version
- 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
@@ -59,4 +65,4 @@ jobs:
fi
echo "Using profile: ${it_profile}"
./mvnw ${MAVEN_ARGS} -T1C -B install -DskipTests -Pno-apt --file pom.xml
- ./mvnw ${MAVEN_ARGS} -T1C -B package -P${it_profile} -Dfabric8-httpclient-impl.name=${{inputs.http-client}} --file pom.xml
\ No newline at end of file
+ ./mvnw ${MAVEN_ARGS} -T1C -B package -P${it_profile} -Dfabric8-httpclient-impl.name=${{inputs.http-client}} --file pom.xml
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index facd6be13a..df0d2eee2b 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -31,4 +31,10 @@ jobs:
run: ./mvnw ${MAVEN_ARGS} clean install -Pno-apt --file pom.xml
build:
- uses: ./.github/workflows/build.yml
\ No newline at end of file
+ name: Integration tests with Kubernetes ${{ matrix.kubernetes }}
+ strategy:
+ matrix:
+ kubernetes: [ 'v1.29.12','1.30.8', '1.31.4', '1.32.0' ]
+ uses: ./.github/workflows/build.yml
+ with:
+ kube-version: ${{ matrix.kubernetes }}
\ No newline at end of file
From cde1bf22641661dfdda6d21f19282dec77e575c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?=
Date: Sat, 22 Feb 2025 12:20:10 +0100
Subject: [PATCH 027/206] fix: patch version handling (#2696)
---
.../api/reconciler/DefaultContext.java | 6 +-
.../event/ReconciliationDispatcher.java | 56 +++++++++++--------
.../event/ReconciliationDispatcherTest.java | 42 +++++++-------
.../junit/LocallyRunOperatorExtension.java | 8 +--
.../ChangeNamespaceTestReconciler.java | 13 ++++-
.../StatusPatchLockingReconciler.java | 1 +
... => StatusPatchNotLockingForNonSSAIT.java} | 3 +-
7 files changed, 74 insertions(+), 55 deletions(-)
rename operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/{StatusPatchNotLockingIT.java => StatusPatchNotLockingForNonSSAIT.java} (95%)
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java
index 4c8b857d47..ce6f67176c 100644
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java
+++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java
@@ -117,7 +117,7 @@ public DefaultContext setRetryInfo(RetryInfo retryInfo) {
return this;
}
- public P getPrimaryResource() {
- return primaryResource;
- }
+ public P getPrimaryResource() {
+ return primaryResource;
+ }
}
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java
index 8c502d41ff..baa7c36121 100644
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java
+++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java
@@ -58,7 +58,8 @@ class ReconciliationDispatcher
{
public ReconciliationDispatcher(Controller
controller) {
this(controller,
- new CustomResourceFacade<>(controller.getCRClient(), controller.getConfiguration()));
+ new CustomResourceFacade<>(controller.getCRClient(), controller.getConfiguration(),
+ controller.getConfiguration().getConfigurationService().getResourceCloner()));
}
public PostExecutionControl
handleExecution(ExecutionScope
executionScope) {
@@ -364,14 +365,16 @@ static class CustomResourceFacade {
private final MixedOperation, Resource> resourceOperation;
private final boolean useSSA;
private final String fieldManager;
+ private final Cloner cloner;
public CustomResourceFacade(
- MixedOperation, Resource> resourceOperation,
- ControllerConfiguration configuration) {
+ MixedOperation, Resource> resourceOperation,
+ ControllerConfiguration configuration, Cloner cloner) {
this.resourceOperation = resourceOperation;
this.useSSA =
configuration.getConfigurationService().useSSAToPatchPrimaryResource();
this.fieldManager = configuration.fieldManager();
+ this.cloner = cloner;
}
public R getResource(String namespace, String name) {
@@ -402,30 +405,37 @@ public R patchResource(R resource, R originalResource) {
public R patchStatus(R resource, R originalResource) {
log.trace("Patching status for resource: {} with ssa: {}", resource, useSSA);
+ if (useSSA) {
+ var managedFields = resource.getMetadata().getManagedFields();
+ try {
+ resource.getMetadata().setManagedFields(null);
+ var res = resource(resource);
+ return res.subresource("status").patch(new PatchContext.Builder()
+ .withFieldManager(fieldManager)
+ .withForce(true)
+ .withPatchType(PatchType.SERVER_SIDE_APPLY)
+ .build());
+ } finally {
+ resource.getMetadata().setManagedFields(managedFields);
+ }
+ } else {
+ return editStatus(resource, originalResource);
+ }
+ }
+
+ private R editStatus(R resource, R originalResource) {
String resourceVersion = resource.getMetadata().getResourceVersion();
- originalResource.getMetadata().setResourceVersion(null);
- resource.getMetadata().setResourceVersion(null);
+ // the cached resource should not be changed in any circumstances
+ // that can lead to all kinds of race conditions.
+ R clonedOriginal = cloner.clone(originalResource);
try {
- if (useSSA) {
- var managedFields = resource.getMetadata().getManagedFields();
- try {
- resource.getMetadata().setManagedFields(null);
- var res = resource(resource);
- return res.subresource("status").patch(new PatchContext.Builder()
- .withFieldManager(fieldManager)
- .withForce(true)
- .withPatchType(PatchType.SERVER_SIDE_APPLY)
- .build());
- } finally {
- resource.getMetadata().setManagedFields(managedFields);
- }
- } else {
- var res = resource(originalResource);
- return res.editStatus(r -> resource);
- }
+ clonedOriginal.getMetadata().setResourceVersion(null);
+ resource.getMetadata().setResourceVersion(null);
+ var res = resource(clonedOriginal);
+ return res.editStatus(r -> resource);
} finally {
// restore initial resource version
- originalResource.getMetadata().setResourceVersion(resourceVersion);
+ clonedOriginal.getMetadata().setResourceVersion(resourceVersion);
resource.getMetadata().setResourceVersion(resourceVersion);
}
}
diff --git a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java
index e5fe1c5882..f8f0c59845 100644
--- a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java
+++ b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java
@@ -7,8 +7,6 @@
import java.util.function.BiFunction;
import java.util.function.Supplier;
-import io.fabric8.kubernetes.client.utils.KubernetesSerialization;
-import io.javaoperatorsdk.operator.api.reconciler.DefaultContext;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
@@ -19,6 +17,7 @@
import io.fabric8.kubernetes.api.model.ObjectMeta;
import io.fabric8.kubernetes.client.CustomResource;
import io.fabric8.kubernetes.client.KubernetesClientException;
+import io.fabric8.kubernetes.client.utils.KubernetesSerialization;
import io.javaoperatorsdk.operator.MockKubernetesClient;
import io.javaoperatorsdk.operator.OperatorException;
import io.javaoperatorsdk.operator.TestUtils;
@@ -29,6 +28,7 @@
import io.javaoperatorsdk.operator.api.config.MockControllerConfiguration;
import io.javaoperatorsdk.operator.api.reconciler.Cleaner;
import io.javaoperatorsdk.operator.api.reconciler.Context;
+import io.javaoperatorsdk.operator.api.reconciler.DefaultContext;
import io.javaoperatorsdk.operator.api.reconciler.DeleteControl;
import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusUpdateControl;
import io.javaoperatorsdk.operator.api.reconciler.Reconciler;
@@ -70,8 +70,9 @@ void setup() {
}
static void initConfigService(boolean useSSA) {
- initConfigService(useSSA,true);
+ initConfigService(useSSA, true);
}
+
static void initConfigService(boolean useSSA, boolean noCloning) {
/*
* We need this for mock reconcilers to properly generate the expected UpdateControl: without
@@ -82,18 +83,19 @@ static void initConfigService(boolean useSSA, boolean noCloning) {
*/
configurationService =
ConfigurationService.newOverriddenConfigurationService(new BaseConfigurationService(),
- overrider -> overrider.checkingCRDAndValidateLocalModel(false)
+ overrider -> overrider.checkingCRDAndValidateLocalModel(false)
.withResourceCloner(new Cloner() {
@Override
public R clone(R object) {
- if (noCloning) {
- return object;
- }else {
- return new KubernetesSerialization().clone(object);
+ if (noCloning) {
+ return object;
+ } else {
+ return new KubernetesSerialization().clone(object);
+ }
}
- }})
- .withUseSSAToPatchPrimaryResource(useSSA));
+ })
+ .withUseSSAToPatchPrimaryResource(useSSA));
}
private ReconciliationDispatcher init(R customResource,
@@ -669,22 +671,24 @@ void reSchedulesFromErrorHandler() {
@Test
void reconcilerContextUsesTheSameInstanceOfResourceAsParam() {
- initConfigService(false,false);
+ initConfigService(false, false);
final ReconciliationDispatcher dispatcher =
- init(testCustomResource, reconciler, null, customResourceFacade, true);
+ init(testCustomResource, reconciler, null, customResourceFacade, true);
testCustomResource.addFinalizer(DEFAULT_FINALIZER);
- ArgumentCaptor contextArgumentCaptor = ArgumentCaptor.forClass(DefaultContext.class);
- ArgumentCaptor customResourceCaptor = ArgumentCaptor.forClass(TestCustomResource.class);
+ ArgumentCaptor contextArgumentCaptor =
+ ArgumentCaptor.forClass(DefaultContext.class);
+ ArgumentCaptor customResourceCaptor =
+ ArgumentCaptor.forClass(TestCustomResource.class);
dispatcher.handleExecution(executionScopeWithCREvent(testCustomResource));
- verify(reconciler, times(1))
- .reconcile(customResourceCaptor.capture(), contextArgumentCaptor.capture());
+ verify(reconciler, times(1))
+ .reconcile(customResourceCaptor.capture(), contextArgumentCaptor.capture());
- assertThat(contextArgumentCaptor.getValue().getPrimaryResource())
- .isSameAs(customResourceCaptor.getValue())
- .isNotSameAs(testCustomResource);
+ assertThat(contextArgumentCaptor.getValue().getPrimaryResource())
+ .isSameAs(customResourceCaptor.getValue())
+ .isNotSameAs(testCustomResource);
}
private ObservedGenCustomResource createObservedGenCustomResource() {
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 45cd85b468..14bc096ff2 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
@@ -8,13 +8,9 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
-import java.util.ArrayDeque;
import java.util.ArrayList;
-import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -22,7 +18,6 @@
import java.util.function.Function;
import java.util.stream.Stream;
-import io.fabric8.kubernetes.client.dsl.NamespaceListVisitFromServerGetDeleteRecreateWaitApplicable;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,7 +44,8 @@ public class LocallyRunOperatorExtension extends AbstractOperatorExtension {
private static final Logger LOGGER = LoggerFactory.getLogger(LocallyRunOperatorExtension.class);
private static final int CRD_DELETE_TIMEOUT = 1000;
private static final Set appliedCRDs = new HashSet<>();
- private static final boolean deleteCRDs = Boolean.parseBoolean(System.getProperty("testsuite.deleteCRDs", "true"));
+ private static final boolean deleteCRDs =
+ Boolean.parseBoolean(System.getProperty("testsuite.deleteCRDs", "true"));
private final Operator operator;
private final List reconcilers;
diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/changenamespace/ChangeNamespaceTestReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/changenamespace/ChangeNamespaceTestReconciler.java
index bac97514b6..fc14b0951f 100644
--- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/changenamespace/ChangeNamespaceTestReconciler.java
+++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/changenamespace/ChangeNamespaceTestReconciler.java
@@ -45,13 +45,20 @@ public UpdateControl reconcile(
.create();
}
- increaseNumberOfResourceExecutions(primary);
if (primary.getStatus() == null) {
primary.setStatus(new ChangeNamespaceTestCustomResourceStatus());
}
+ increaseNumberOfResourceExecutions(primary);
+
+ var statusPatchResource = new ChangeNamespaceTestCustomResource();
+ statusPatchResource.setMetadata(new ObjectMetaBuilder()
+ .withName(primary.getMetadata().getName())
+ .withNamespace(primary.getMetadata().getNamespace())
+ .build());
+ statusPatchResource.setStatus(new ChangeNamespaceTestCustomResourceStatus());
var statusUpdates = primary.getStatus().getNumberOfStatusUpdates();
- primary.getStatus().setNumberOfStatusUpdates(statusUpdates + 1);
- return UpdateControl.patchStatus(primary);
+ statusPatchResource.getStatus().setNumberOfStatusUpdates(statusUpdates + 1);
+ return UpdateControl.patchStatus(statusPatchResource);
}
private void increaseNumberOfResourceExecutions(ChangeNamespaceTestCustomResource primary) {
diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchLockingReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchLockingReconciler.java
index 9cafaa26ec..46f0e63331 100644
--- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchLockingReconciler.java
+++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchLockingReconciler.java
@@ -21,6 +21,7 @@ public UpdateControl reconcile(
throws InterruptedException {
numberOfExecutions.addAndGet(1);
Thread.sleep(WAIT_TIME);
+
if (resource.getStatus() == null) {
resource.setStatus(new StatusPatchLockingCustomResourceStatus());
}
diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchNotLockingIT.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchNotLockingForNonSSAIT.java
similarity index 95%
rename from operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchNotLockingIT.java
rename to operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchNotLockingForNonSSAIT.java
index 24ce2d1047..2363a86392 100644
--- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchNotLockingIT.java
+++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchNotLockingForNonSSAIT.java
@@ -14,13 +14,14 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
-class StatusPatchNotLockingIT {
+class StatusPatchNotLockingForNonSSAIT {
public static final String TEST_RESOURCE_NAME = "test";
@RegisterExtension
LocallyRunOperatorExtension operator =
LocallyRunOperatorExtension.builder().withReconciler(StatusPatchLockingReconciler.class)
+ .withConfigurationService(o -> o.withUseSSAToPatchPrimaryResource(false))
.build();
@Test
From bae8da37fe271beaaea2d561784988d80daac3dd Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 22 Feb 2025 12:50:08 +0100
Subject: [PATCH 028/206] chore(deps): bump
com.diffplug.spotless:spotless-maven-plugin (#2693)
Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.43.0 to 2.44.3.
- [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/lib/2.43.0...maven/2.44.3)
---
updated-dependencies:
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
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>
---
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 9874f8ce76..779a9feac4 100644
--- a/operator-framework-bom/pom.xml
+++ b/operator-framework-bom/pom.xml
@@ -45,7 +45,7 @@
3.2.7
3.3.1
3.11.2
- 2.43.0
+ 2.44.3
diff --git a/pom.xml b/pom.xml
index 25d6bb558b..c2611e448e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
3.1.3
9.0.1
3.4.4
- 2.43.0
+ 2.44.3
From 795f83573f15cafe4ec321c5ec69bf765beb6139 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 24 Feb 2025 09:52:42 +0100
Subject: [PATCH 029/206] chore(deps): bump org.awaitility:awaitility from
4.2.2 to 4.3.0 (#2701)
---
pom.xml | 2 +-
sample-operators/tomcat-operator/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index c2611e448e..aacd726f55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@
0.21.0
1.13.0
3.27.3
- 4.2.2
+ 4.3.0
2.7.3
1.14.4
3.2.0
diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml
index dac3246700..e369188763 100644
--- a/sample-operators/tomcat-operator/pom.xml
+++ b/sample-operators/tomcat-operator/pom.xml
@@ -67,7 +67,7 @@
org.awaitility
awaitility
- 4.2.2
+ 4.3.0
test
From 42f7432a8e7b80d157c89d2f62ed861244f796b1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 24 Feb 2025 09:53:10 +0100
Subject: [PATCH 030/206] chore(deps): bump org.junit:junit-bom from 5.11.4 to
5.12.0 (#2700)
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index aacd726f55..8dde4ba60f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,7 +60,7 @@
https://sonarcloud.io
jdk
- 5.11.4
+ 5.12.0
7.1.0
2.0.12
2.24.3
From 2d9d57ca91f6d67bcc593383df6f9cad633164f7 Mon Sep 17 00:00:00 2001
From: GitHub Action
Date: Tue, 25 Feb 2025 12:17:06 +0000
Subject: [PATCH 031/206] 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 5756037cd8..535945760f 100644
--- a/bootstrapper-maven-plugin/pom.xml
+++ b/bootstrapper-maven-plugin/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
bootstrapper
diff --git a/caffeine-bounded-cache-support/pom.xml b/caffeine-bounded-cache-support/pom.xml
index ce51895803..bd51e0af11 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.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
caffeine-bounded-cache-support
diff --git a/micrometer-support/pom.xml b/micrometer-support/pom.xml
index d39a5fad8f..67fe0d4b4c 100644
--- a/micrometer-support/pom.xml
+++ b/micrometer-support/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
micrometer-support
diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml
index 779a9feac4..7f1617c457 100644
--- a/operator-framework-bom/pom.xml
+++ b/operator-framework-bom/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
operator-framework-bom
- 5.0.3-SNAPSHOT
+ 5.0.4-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 61e7d71e4c..a4dc87a3d3 100644
--- a/operator-framework-core/pom.xml
+++ b/operator-framework-core/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
../pom.xml
diff --git a/operator-framework-junit5/pom.xml b/operator-framework-junit5/pom.xml
index dd319d954b..d2075303be 100644
--- a/operator-framework-junit5/pom.xml
+++ b/operator-framework-junit5/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
operator-framework-junit-5
diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml
index a9ff8d2334..e2aae87401 100644
--- a/operator-framework/pom.xml
+++ b/operator-framework/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
operator-framework
diff --git a/pom.xml b/pom.xml
index 8dde4ba60f..7cd433671b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.3-SNAPSHOT
+ 5.0.4-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 133a745ddb..9608b44db1 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.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
sample-controller-namespace-deletion
diff --git a/sample-operators/leader-election/pom.xml b/sample-operators/leader-election/pom.xml
index 4002f98450..74aab104f1 100644
--- a/sample-operators/leader-election/pom.xml
+++ b/sample-operators/leader-election/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
sample-leader-election
diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml
index 9e91548801..d0e5beab97 100644
--- a/sample-operators/mysql-schema/pom.xml
+++ b/sample-operators/mysql-schema/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
sample-mysql-schema-operator
diff --git a/sample-operators/pom.xml b/sample-operators/pom.xml
index 8aa9a53fce..450a6bc153 100644
--- a/sample-operators/pom.xml
+++ b/sample-operators/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
java-operator-sdk
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
sample-operators
diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml
index e369188763..314e0ef96c 100644
--- a/sample-operators/tomcat-operator/pom.xml
+++ b/sample-operators/tomcat-operator/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
sample-tomcat-operator
diff --git a/sample-operators/webpage/pom.xml b/sample-operators/webpage/pom.xml
index 192853edc3..2266303adc 100644
--- a/sample-operators/webpage/pom.xml
+++ b/sample-operators/webpage/pom.xml
@@ -5,7 +5,7 @@
io.javaoperatorsdk
sample-operators
- 5.0.3-SNAPSHOT
+ 5.0.4-SNAPSHOT
sample-webpage-operator
From b2106f000493d55b14535fd26d235b0a25a4db72 Mon Sep 17 00:00:00 2001
From: Chris Laprun
Date: Tue, 25 Feb 2025 19:15:05 +0100
Subject: [PATCH 032/206] feat: enable deactivation of MDC logging (#2699)
Signed-off-by: Chris Laprun
---
.../operator/api/config/Utils.java | 3 +-
.../operator/processing/MDCUtils.java | 58 ++++++++++++-------
2 files changed, 38 insertions(+), 23 deletions(-)
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/Utils.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/Utils.java
index ea776f3a6c..15ffe178e5 100644
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/Utils.java
+++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/Utils.java
@@ -23,6 +23,7 @@ public class Utils {
private static final Logger log = LoggerFactory.getLogger(Utils.class);
public static final String CHECK_CRD_ENV_KEY = "JAVA_OPERATOR_SDK_CHECK_CRD";
public static final String DEBUG_THREAD_POOL_ENV_KEY = "JAVA_OPERATOR_SDK_DEBUG_THREAD_POOL";
+ public static final String USE_MDC_ENV_KEY = "JAVA_OPERATOR_SDK_USE_MDC";
public static final String GENERIC_PARAMETER_TYPE_ERROR_PREFIX =
"Couldn't retrieve generic parameter type from ";
@@ -97,7 +98,7 @@ public static boolean debugThreadPool() {
return getBooleanFromSystemPropsOrDefault(DEBUG_THREAD_POOL_ENV_KEY, false);
}
- static boolean getBooleanFromSystemPropsOrDefault(String propertyName, boolean defaultValue) {
+ public static boolean getBooleanFromSystemPropsOrDefault(String propertyName, boolean defaultValue) {
var property = System.getProperty(propertyName);
if (property == null) {
return defaultValue;
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/MDCUtils.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/MDCUtils.java
index e26df4d5a9..d8bb3897c3 100644
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/MDCUtils.java
+++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/MDCUtils.java
@@ -1,5 +1,7 @@
package io.javaoperatorsdk.operator.processing;
+import io.fabric8.kubernetes.api.model.ObjectMeta;
+import io.javaoperatorsdk.operator.api.config.Utils;
import org.slf4j.MDC;
import io.fabric8.kubernetes.api.model.HasMetadata;
@@ -15,38 +17,50 @@ public class MDCUtils {
private static final String GENERATION = "resource.generation";
private static final String UID = "resource.uid";
private static final String NO_NAMESPACE = "no namespace";
+ private static final boolean enabled = Utils.getBooleanFromSystemPropsOrDefault(Utils.USE_MDC_ENV_KEY, true);
public static void addResourceIDInfo(ResourceID resourceID) {
- MDC.put(NAME, resourceID.getName());
- MDC.put(NAMESPACE, resourceID.getNamespace().orElse(NO_NAMESPACE));
+ if (enabled) {
+ MDC.put(NAME, resourceID.getName());
+ MDC.put(NAMESPACE, resourceID.getNamespace().orElse(NO_NAMESPACE));
+ }
}
public static void removeResourceIDInfo() {
- MDC.remove(NAME);
- MDC.remove(NAMESPACE);
+ if (enabled) {
+ MDC.remove(NAME);
+ MDC.remove(NAMESPACE);
+ }
}
public static void addResourceInfo(HasMetadata resource) {
- MDC.put(API_VERSION, resource.getApiVersion());
- MDC.put(KIND, resource.getKind());
- MDC.put(NAME, resource.getMetadata().getName());
- if (resource.getMetadata().getNamespace() != null) {
- MDC.put(NAMESPACE, resource.getMetadata().getNamespace());
- }
- MDC.put(RESOURCE_VERSION, resource.getMetadata().getResourceVersion());
- if (resource.getMetadata().getGeneration() != null) {
- MDC.put(GENERATION, resource.getMetadata().getGeneration().toString());
- }
- MDC.put(UID, resource.getMetadata().getUid());
+ if (enabled) {
+ MDC.put(API_VERSION, resource.getApiVersion());
+ MDC.put(KIND, resource.getKind());
+ final var metadata = resource.getMetadata();
+ if (metadata != null) {
+ MDC.put(NAME, metadata.getName());
+ if (metadata.getNamespace() != null) {
+ MDC.put(NAMESPACE, metadata.getNamespace());
+ }
+ MDC.put(RESOURCE_VERSION, metadata.getResourceVersion());
+ if (metadata.getGeneration() != null) {
+ MDC.put(GENERATION, metadata.getGeneration().toString());
+ }
+ MDC.put(UID, metadata.getUid());
+ }
+ }
}
public static void removeResourceInfo() {
- MDC.remove(API_VERSION);
- MDC.remove(KIND);
- MDC.remove(NAME);
- MDC.remove(NAMESPACE);
- MDC.remove(RESOURCE_VERSION);
- MDC.remove(GENERATION);
- MDC.remove(UID);
+ if (enabled) {
+ MDC.remove(API_VERSION);
+ MDC.remove(KIND);
+ MDC.remove(NAME);
+ MDC.remove(NAMESPACE);
+ MDC.remove(RESOURCE_VERSION);
+ MDC.remove(GENERATION);
+ MDC.remove(UID);
+ }
}
}
From ea57fed2d8f90b90e8dac3b6c80831276407bda9 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 26 Feb 2025 11:25:53 +0100
Subject: [PATCH 033/206] chore(deps): bump
org.apache.maven.plugins:maven-compiler-plugin (#2703)
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.14.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.14.0)
---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
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 7cd433671b..0f4cfa6ab0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,7 +78,7 @@
4.15
2.11
- 3.12.1
+ 3.14.0
3.5.2
3.11.2
3.3.1
From dfaf06f23a57c049a5c75f5f17bb3e6c615794b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?=
Date: Thu, 27 Feb 2025 12:10:21 +0100
Subject: [PATCH 034/206] docs: blog post on SSA (#2689)
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/blog/news/_index.md | 2 +-
docs/content/en/blog/news/nonssa-vs-ssa.md | 89 +++++++++++++++++++++
docs/content/en/blog/releases/v5-release.md | 2 +-
3 files changed, 91 insertions(+), 2 deletions(-)
create mode 100644 docs/content/en/blog/news/nonssa-vs-ssa.md
diff --git a/docs/content/en/blog/news/_index.md b/docs/content/en/blog/news/_index.md
index c609aa2543..646c97f954 100644
--- a/docs/content/en/blog/news/_index.md
+++ b/docs/content/en/blog/news/_index.md
@@ -1,4 +1,4 @@
---
-title: News
+title: Posts
weight: 20
---
diff --git a/docs/content/en/blog/news/nonssa-vs-ssa.md b/docs/content/en/blog/news/nonssa-vs-ssa.md
new file mode 100644
index 0000000000..241828d3e3
--- /dev/null
+++ b/docs/content/en/blog/news/nonssa-vs-ssa.md
@@ -0,0 +1,89 @@
+---
+title: From legacy approach to server-side apply
+date: 2025-02-25
+---
+
+From version 5 of Java Operator SDK [server side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/)
+is a first-class feature and is used by default to update resources.
+As we will see, unfortunately (or fortunately), using it requires changes for your reconciler implementation.
+
+For this reason, we prepared a feature flag, which you can flip if you are not prepared to migrate yet:
+[`ConfigurationService.useSSAToPatchPrimaryResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L493)
+
+Setting this flag to false will make the operations done by `UpdateControl` using the former approach (not SSA).
+Similarly, the finalizer handling won't utilize SSA handling.
+The plan is to keep this flag and allow the use of the former approach (non-SSA) also in future releases.
+
+For dependent resources, a separate flag exists (this was true also before v5) to use SSA or not:
+[`ConfigurationService.ssaBasedCreateUpdateMatchForDependentResources`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L373)
+
+
+## Resource handling without and with SSA
+
+Until version 5, changing primary resources through `UpdateControl` did not use server-side apply.
+So usually, the implementation of the reconciler looked something like this:
+
+```java
+
+ @Override
+ public UpdateControl reconcile(WebPage webPage, Context context) {
+
+ reconcileLogicForManagedResources(webPage);
+ webPage.setStatus(updatedStatusForWebPage(webPage));
+
+ return UpdateControl.patchStatus(webPage);
+ }
+
+```
+
+In other words, after the reconciliation of managed resources, the reconciler updates the status of the
+primary resource passed as an argument to the reconciler.
+Such changes on the primary are fine since we don't work directly with the cached object, the argument is
+already cloned.
+
+So, how does this change with SSA?
+For SSA, the updates should contain (only) the "fully specified intent".
+In other words, we should only fill in the values we care about.
+In practice, it means creating a **fresh copy** of the resource and setting only what is necessary:
+
+```java
+
+@Override
+public UpdateControl reconcile(WebPage webPage, Context context) {
+
+ reconcileLogicForManagedResources(webPage);
+
+ WebPage statusPatch = new WebPage();
+ statusPatch.setMetadata(new ObjectMetaBuilder()
+ .withName(webPage.getMetadata().getName())
+ .withNamespace(webPage.getMetadata().getNamespace())
+ .build());
+ statusPatch.setStatus(updatedStatusForWebPage(webPage));
+
+ return UpdateControl.patchStatus(statusPatch);
+}
+```
+
+Note that we just filled out the status here since we patched the status (not the resource spec).
+Since the status is a sub-resource in Kubernetes, it will only update the status part.
+
+Every controller you register will have its default [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#managers).
+You can override the field manager name using [`ControllerConfiguration.fieldManager`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java#L89).
+That will set the field manager for the primary resource and dependent resources as well.
+
+## Migrating to SSA
+
+Using the legacy or the new SSA way of resource management works well.
+However, migrating existing resources to SSA might be a challenge.
+We strongly recommend testing the migration, thus implementing an integration test where
+a custom resource is created using the legacy approach and is managed by the new approach.
+
+We prepared an integration test to demonstrate how such migration, even in a simple case, can go wrong,
+and how to fix it.
+
+To fix some cases, you might need to [strip managed fields](https://kubernetes.io/docs/reference/using-api/server-side-apply/#clearing-managedfields)
+from the custom resource.
+
+See [`StatusPatchSSAMigrationIT`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchSSAMigrationIT.java) for details.
+
+Feel free to report common issues, so we can prepare some utilities to handle them.
diff --git a/docs/content/en/blog/releases/v5-release.md b/docs/content/en/blog/releases/v5-release.md
index 8d5fe36dbe..6d14dfb73a 100644
--- a/docs/content/en/blog/releases/v5-release.md
+++ b/docs/content/en/blog/releases/v5-release.md
@@ -41,7 +41,7 @@ to `false`.
See some identified problematic migration cases and how to handle them
in [StatusPatchSSAMigrationIT](https://github.com/operator-framework/java-operator-sdk/blob/1635c9ea338f8e89bacc547808d2b409de8734cf/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchSSAMigrationIT.java).
-TODO using new instance to update status always,
+For more detailed description, see our [blog post](../news/nonssa-vs-ssa.md) on SSA.
### Event Sources related changes
From b4287321008eb8f817850a3fc519374b07840e24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?=
Date: Thu, 27 Feb 2025 13:43:24 +0100
Subject: [PATCH 035/206] docs: add section on otpimisitic locking to SSA blog
(#2710)
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/blog/news/nonssa-vs-ssa.md | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/docs/content/en/blog/news/nonssa-vs-ssa.md b/docs/content/en/blog/news/nonssa-vs-ssa.md
index 241828d3e3..e95fb0a295 100644
--- a/docs/content/en/blog/news/nonssa-vs-ssa.md
+++ b/docs/content/en/blog/news/nonssa-vs-ssa.md
@@ -87,3 +87,29 @@ from the custom resource.
See [`StatusPatchSSAMigrationIT`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchSSAMigrationIT.java) for details.
Feel free to report common issues, so we can prepare some utilities to handle them.
+
+## Optimistic concurrency control
+
+When you create a resource for SSA as mentioned above, the framework will apply changes even if the underlying resource
+or status subresource is changed while the reconciliation was running.
+First, it always forces the conflicts in the background as advised in [Kubernetes docs](https://kubernetes.io/docs/reference/using-api/server-side-apply/#using-server-side-apply-in-a-controller),
+ in addition to that since the resource version is not set it won't do optimistic locking. If you still
+want to have optimistic locking for the patch, use the resource version of the original resource:
+
+```java
+@Override
+public UpdateControl reconcile(WebPage webPage, Context context) {
+
+ reconcileLogicForManagedResources(webPage);
+
+ WebPage statusPatch = new WebPage();
+ statusPatch.setMetadata(new ObjectMetaBuilder()
+ .withName(webPage.getMetadata().getName())
+ .withNamespace(webPage.getMetadata().getNamespace())
+ .withResourceVersion(webPage.getMetadata().getResourceVersion())
+ .build());
+ statusPatch.setStatus(updatedStatusForWebPage(webPage));
+
+ return UpdateControl.patchStatus(statusPatch);
+}
+```
From 7816acab571bb59c8c8734c3c457e22115475483 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 28 Feb 2025 07:50:42 +0100
Subject: [PATCH 036/206] chore(deps): bump
org.apache.maven.plugins:maven-install-plugin (#2712)
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 0f4cfa6ab0..a4dbc128ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,7 +88,7 @@
3.2.7
1.7.0
3.0.0
- 3.1.3
+ 3.1.4
9.0.1
3.4.4
2.44.3
From 9057d5f8d52264e13a98a2aa31cae4c59cff2cd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?=
Date: Fri, 28 Feb 2025 14:16:08 +0100
Subject: [PATCH 037/206] docs: add author to blog post (#2715)
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/blog/news/nonssa-vs-ssa.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/content/en/blog/news/nonssa-vs-ssa.md b/docs/content/en/blog/news/nonssa-vs-ssa.md
index e95fb0a295..8ea7497771 100644
--- a/docs/content/en/blog/news/nonssa-vs-ssa.md
+++ b/docs/content/en/blog/news/nonssa-vs-ssa.md
@@ -1,6 +1,8 @@
---
title: From legacy approach to server-side apply
date: 2025-02-25
+author: >-
+ [Attila Mészáros](https://github.com/csviri)
---
From version 5 of Java Operator SDK [server side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/)
From 18e58248b6535f586a1e014b6bb00587802c8677 Mon Sep 17 00:00:00 2001
From: Martin Stefanko
Date: Fri, 28 Feb 2025 16:06:51 +0100
Subject: [PATCH 038/206] fix: GH actions revert to use less Minikube downloads
(#2713)
Signed-off-by: xstefank
---
.github/workflows/build.yml | 60 +++----------------------
.github/workflows/integration-tests.yml | 25 +++--------
.github/workflows/pr.yml | 6 ---
3 files changed, 13 insertions(+), 78 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 97555ae1b5..18fc5ec1ad 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -5,69 +5,31 @@ env:
on:
workflow_call:
- inputs:
- kube-version:
- type: string
- required: true
jobs:
- set_up_kubernetes:
- name: Set up Kubernetes ${{ inputs.kube-version }}
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set up Minikube
- uses: manusa/actions-setup-minikube@v2.13.1
- with:
- minikube version: 'v1.34.0'
- kubernetes version: '${{ inputs.kube-version }}'
- driver: 'docker'
- github token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Save minikube directory
- id: minikube
- run: |
- echo "minikube-dir=$MINIKUBE_HOME" >> $GITHUB_OUTPUT
-
- - name: Upload minikube
- uses: actions/upload-artifact@v4
- with:
- name: minikube-${{ inputs.kube-version }}
- path: ${{ steps.minikube.outputs.minikube-dir }}
- include-hidden-files: true
-
integration_tests:
- name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}"
- needs: set_up_kubernetes
strategy:
matrix:
java: [ 17, 21 ]
- it-category: [ 'baseapi', 'dependent', 'workflow' ]
+ kubernetes: [ 'v1.29.12','1.30.8', '1.31.4', '1.32.0' ]
uses: ./.github/workflows/integration-tests.yml
with:
- kube-version: ${{ inputs.kube-version }}
java-version: ${{ matrix.java }}
- it-category: ${{ matrix.it-category }}
+ kube-version: ${{ matrix.kubernetes }}
- http_client_tests:
- name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}, HTTP client: ${{ matrix.httpclient }}"
- needs: set_up_kubernetes
+ httpclient-tests:
strategy:
matrix:
- java: [ 17, 21 ]
- it-category: [ 'baseapi' ]
httpclient: [ 'vertx', 'jdk', 'jetty' ]
uses: ./.github/workflows/integration-tests.yml
with:
- kube-version: ${{ inputs.kube-version }}
- java-version: ${{ matrix.java }}
- it-category: ${{ matrix.it-category }}
+ java-version: 21
+ kube-version: '1.32.0'
http-client: ${{ matrix.httpclient }}
+ experimental: true
special_integration_tests:
name: "Special integration tests (${{ matrix.java }})"
- needs: set_up_kubernetes
runs-on: ubuntu-latest
strategy:
matrix:
@@ -81,13 +43,3 @@ jobs:
java-version: ${{ matrix.java }}
- name: Run Special Integration Tests
run: ./mvnw ${MAVEN_ARGS} -B package -P minimal-watch-timeout-dependent-it --file pom.xml
-
- delete_kubernetes:
- needs: [ integration_tests, http_client_tests, special_integration_tests ]
- if: always()
- name: Delete Kubernetes ${{ inputs.kube-version }} artifact
- runs-on: ubuntu-latest
- steps:
- - uses: geekyeggo/delete-artifact@v5
- with:
- name: minikube-${{ inputs.kube-version }}
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index dff59bfe7c..d5aca2ad54 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -21,20 +21,14 @@ on:
type: string
required: false
default: ''
- it-category:
- type: string
- required: false
- default: ''
jobs:
integration_tests:
- name: "Experimental: ${{ inputs.experimental }}, Checkout ref: ${{ inputs.checkout-ref }}"
+ name: Integration tests (${{ inputs.java-version }}, ${{ inputs.kube-version }}, ${{ inputs.http-client }})
runs-on: ubuntu-latest
continue-on-error: ${{ inputs.experimental }}
timeout-minutes: 40
steps:
- - name: Output test information
- run: echo "Running ITs with ${{ inputs.http-client }}, ${{ inputs.kube-version }}, ${{ inputs.java-version }}"
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout-ref }}
@@ -44,18 +38,13 @@ jobs:
distribution: temurin
java-version: ${{ inputs.java-version }}
cache: 'maven'
- - name: Download minikube artifact for Kubernetes ${{ inputs.kube-version }}
- uses: actions/download-artifact@v4
+ - name: Set up Minikube
+ uses: manusa/actions-setup-minikube@v2.13.1
with:
- name: minikube-${{inputs.kube-version}}
- path: minikube
- - name: Start minikube with Kubernetes ${{ inputs.kube-version }}
- run: |
- # wait for docker
- docker version -f '{{.Server.Version}} - {{.Client.Version}}'
- export MINIKUBE_HOME=$PWD/minikube
- minikube start --driver=docker
- kubectl version
+ minikube version: 'v1.34.0'
+ kubernetes version: '${{ inputs.kube-version }}'
+ driver: 'docker'
+ github token: ${{ secrets.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
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index df0d2eee2b..dea18217f9 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -31,10 +31,4 @@ jobs:
run: ./mvnw ${MAVEN_ARGS} clean install -Pno-apt --file pom.xml
build:
- name: Integration tests with Kubernetes ${{ matrix.kubernetes }}
- strategy:
- matrix:
- kubernetes: [ 'v1.29.12','1.30.8', '1.31.4', '1.32.0' ]
uses: ./.github/workflows/build.yml
- with:
- kube-version: ${{ matrix.kubernetes }}
\ No newline at end of file
From 647317a7113a90bd0bd9354c65e5bfb03ddd8148 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?=
Date: Fri, 28 Feb 2025 16:55:43 +0100
Subject: [PATCH 039/206] chore: bump docsy and hugo fix templating issue
(#2714)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Attila Mészáros
---
.github/workflows/hugo.yaml | 2 +-
docs/go.mod | 2 +-
docs/go.sum | 3 +
docs/layouts/partials/scripts/mermaid.html | 68 ++++++++++++++++++++++
docs/package.json | 8 +--
5 files changed, 77 insertions(+), 6 deletions(-)
create mode 100644 docs/layouts/partials/scripts/mermaid.html
diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml
index 1d91c85ef3..511f10a8e0 100644
--- a/.github/workflows/hugo.yaml
+++ b/.github/workflows/hugo.yaml
@@ -32,7 +32,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
- HUGO_VERSION: 0.125.4
+ HUGO_VERSION: 0.145.0
steps:
- name: Install Hugo CLI
run: |
diff --git a/docs/go.mod b/docs/go.mod
index 00890a6408..65768398bb 100644
--- a/docs/go.mod
+++ b/docs/go.mod
@@ -2,4 +2,4 @@ module github.com/google/docsy-example
go 1.12
-require github.com/google/docsy v0.10.0 // indirect
+require github.com/google/docsy v0.11.0 // indirect
diff --git a/docs/go.sum b/docs/go.sum
index 1b3ed24b03..c7a05f45f1 100644
--- a/docs/go.sum
+++ b/docs/go.sum
@@ -1,9 +1,12 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
+github.com/FortAwesome/Font-Awesome v0.0.0-20240716171331-37eff7fa00de/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.9.1 h1:+jqges1YCd+yHeuZ1BUvD8V8mEGVtPxULg5j/vaJ984=
github.com/google/docsy v0.9.1/go.mod h1:saOqKEUOn07Bc0orM/JdIF3VkOanHta9LU5Y53bwN2U=
github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg=
github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
+github.com/google/docsy v0.11.0 h1:QnV40cc28QwS++kP9qINtrIv4hlASruhC/K3FqkHAmM=
+github.com/google/docsy v0.11.0/go.mod h1:hGGW0OjNuG5ZbH5JRtALY3yvN8ybbEP/v2iaK4bwOUI=
github.com/twbs/bootstrap v5.2.3+incompatible h1:lOmsJx587qfF7/gE7Vv4FxEofegyJlEACeVV+Mt7cgc=
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
diff --git a/docs/layouts/partials/scripts/mermaid.html b/docs/layouts/partials/scripts/mermaid.html
new file mode 100644
index 0000000000..ac9290a10f
--- /dev/null
+++ b/docs/layouts/partials/scripts/mermaid.html
@@ -0,0 +1,68 @@
+
+{{ $version := .Site.Params.mermaid.version | default "latest" -}}
+
+{{ $cdnurl := printf "https://cdn.jsdelivr.net/npm/mermaid@%s/dist/mermaid.esm.min.mjs" $version -}}
+{{ with try (resources.GetRemote $cdnurl) -}}
+{{ with .Err -}}
+{{ errorf "Could not retrieve mermaid script from CDN. Reason: %s." . -}}
+{{ end -}}
+{{ else -}}
+{{ errorf "Invalid Mermaid version %s, could not retrieve this version from CDN." $version -}}
+{{ end -}}
+
+
\ No newline at end of file
diff --git a/docs/package.json b/docs/package.json
index 02cc7f496a..a5a57eaa4c 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -1,7 +1,7 @@
{
- "name": "docsy-example-site",
- "version": "0.9.1",
- "version.next": "0.9.2-dev.0-unreleased",
+ "name": "java-operator-sdk",
+ "version": "0.10.0",
+ "version.next": "0.10.1-dev.0-unreleased",
"description": "Example site that uses Docsy theme for technical documentation.",
"repository": "github:google/docsy-example",
"homepage": "https://javaoperatorsdk.io/",
@@ -34,7 +34,7 @@
"update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest"
},
"devDependencies": {
- "autoprefixer": "^10.4.19",
+ "autoprefixer": "^10.4.20",
"cross-env": "^7.0.3",
"hugo-extended": "0.125.4",
"postcss-cli": "^11.0.0"
From ba2dd39b931ba4ff64cef67171eace7333512183 Mon Sep 17 00:00:00 2001
From: Martin Stefanko
Date: Mon, 3 Mar 2025 13:40:17 +0100
Subject: [PATCH 040/206] fix: spotless plugin (googleJavaFormat) (#2706)
Signed-off-by: xstefank
---
.vscode/settings.json | 2 +-
CONTRIBUTING.md | 8 +-
.../boostrapper/Bootstrapper.java | 67 +-
.../boostrapper/BootstrapperMojo.java | 6 +-
.../bootstrapper/BootstrapperTest.java | 8 +-
.../source/cache/CaffeineBoundedCache.java | 4 +-
.../cache/CaffeineBoundedItemStores.java | 24 +-
.../source/cache/BoundedCacheTestBase.java | 64 +-
.../CaffeineBoundedCacheClusterScopeIT.java | 21 +-
.../CaffeineBoundedCacheNamespacedIT.java | 22 +-
.../cache/sample/AbstractTestReconciler.java | 66 +-
...edCacheClusterScopeTestCustomResource.java | 3 +-
...oundedCacheClusterScopeTestReconciler.java | 4 +-
.../BoundedCacheTestCustomResource.java | 3 +-
.../BoundedCacheTestStatus.java | 3 +-
contributing/eclipse-google-style.xml | 337 ----------
contributing/eclipse.importorder | 7 -
docs/content/en/docs/contributing/_index.md | 4 +-
.../micrometer/MicrometerMetrics.java | 99 +--
.../AbstractMicrometerMetricsTestFixture.java | 19 +-
.../DelayedMetricsCleaningOnDeleteIT.java | 4 +-
operator-framework-bom/pom.xml | 23 +-
.../operator/AggregatedOperatorException.java | 8 +-
.../operator/BuilderUtils.java | 9 +-
.../operator/ControllerManager.java | 37 +-
.../operator/LeaderElectionManager.java | 82 +--
.../io/javaoperatorsdk/operator/Operator.java | 57 +-
.../operator/ReconcilerUtils.java | 55 +-
.../operator/RegisteredController.java | 1 -
.../javaoperatorsdk/operator/RuntimeInfo.java | 23 +-
.../config/AbstractConfigurationService.java | 43 +-
.../api/config/BaseConfigurationService.java | 178 +++---
.../operator/api/config/Cloner.java | 1 -
.../api/config/ConfigurationService.java | 216 +++----
.../config/ConfigurationServiceOverrider.java | 69 ++-
.../api/config/ControllerConfiguration.java | 15 +-
.../ControllerConfigurationOverrider.java | 32 +-
.../config/DefaultResourceClassResolver.java | 4 +-
.../api/config/ExecutorServiceManager.java | 86 +--
.../operator/api/config/Informable.java | 1 -
.../config/LeaderElectionConfiguration.java | 15 +-
.../LeaderElectionConfigurationBuilder.java | 11 +-
.../api/config/NamespaceChangeable.java | 8 +-
.../ResolvedControllerConfiguration.java | 71 ++-
.../api/config/ResourceClassResolver.java | 1 -
.../operator/api/config/Utils.java | 145 +++--
.../operator/api/config/Version.java | 4 +-
.../dependent/ConfigurationConverter.java | 4 +-
...ependentResourceConfigurationResolver.java | 48 +-
.../dependent/DependentResourceSpec.java | 21 +-
.../api/config/informer/Informer.java | 31 +-
.../informer/InformerConfiguration.java | 147 ++---
.../InformerEventSourceConfiguration.java | 58 +-
.../operator/api/monitoring/Metrics.java | 64 +-
.../operator/api/reconciler/Cleaner.java | 24 +-
.../operator/api/reconciler/Context.java | 15 +-
.../reconciler/ControllerConfiguration.java | 18 +-
.../api/reconciler/DefaultContext.java | 6 +-
.../api/reconciler/EventSourceContext.java | 11 +-
.../api/reconciler/EventSourceUtils.java | 9 +-
.../operator/api/reconciler/Ignore.java | 4 +-
.../reconciler/MaxReconciliationInterval.java | 15 +-
.../operator/api/reconciler/Reconciler.java | 22 +-
.../operator/api/reconciler/RetryInfo.java | 2 +-
.../api/reconciler/UpdateControl.java | 15 +-
.../operator/api/reconciler/Workflow.java | 21 +-
.../api/reconciler/dependent/Dependent.java | 35 +-
.../dependent/DependentResource.java | 17 +-
.../dependent/DependentResourceFactory.java | 12 +-
.../dependent/EventSourceReferencer.java | 1 -
.../dependent/GarbageCollected.java | 35 +-
.../api/reconciler/dependent/NameSetter.java | 1 -
.../reconciler/dependent/ReconcileResult.java | 16 +-
.../managed/ConfiguredDependentResource.java | 1 -
...edWorkflowAndDependentResourceContext.java | 32 +-
.../ManagedDependentResourceException.java | 4 +-
...edWorkflowAndDependentResourceContext.java | 23 +-
.../operator/health/ControllerHealthInfo.java | 24 +-
.../health/EventSourceHealthIndicator.java | 4 +-
...merWrappingEventSourceHealthIndicator.java | 6 +-
.../operator/health/Status.java | 9 +-
.../operator/processing/Controller.java | 84 +--
.../operator/processing/GroupVersionKind.java | 27 +-
.../operator/processing/LoggingUtils.java | 1 -
.../operator/processing/MDCUtils.java | 70 +--
.../dependent/AbstractDependentResource.java | 40 +-
...actEventSourceHolderDependentResource.java | 12 +-
.../AbstractExternalDependentResource.java | 26 +-
.../dependent/BulkDependentResource.java | 20 +-
.../BulkDependentResourceReconciler.java | 36 +-
.../processing/dependent/BulkUpdater.java | 12 +-
.../dependent/CRUDBulkDependentResource.java | 6 +-
.../DependentResourceWithExplicitState.java | 1 -
.../processing/dependent/Matcher.java | 22 +-
.../processing/dependent/Updater.java | 1 -
.../PerResourcePollingDependentResource.java | 8 +-
.../external/PollingDependentResource.java | 8 +-
.../kubernetes/BooleanWithUndefined.java | 8 +-
.../CRUDKubernetesDependentResource.java | 3 +-
.../CRUDNoGCKubernetesDependentResource.java | 8 +-
.../GenericKubernetesDependentResource.java | 8 +-
.../GenericKubernetesResourceMatcher.java | 113 ++--
.../kubernetes/GenericResourceUpdater.java | 1 -
.../kubernetes/GroupVersionKindPlural.java | 31 +-
.../kubernetes/KubernetesDependent.java | 22 +-
.../KubernetesDependentConverter.java | 31 +-
.../KubernetesDependentResource.java | 106 ++--
.../KubernetesDependentResourceConfig.java | 2 -
...ernetesDependentResourceConfigBuilder.java | 4 +-
.../kubernetes/ResourceComparators.java | 10 +-
.../ResourceRequirementsSanitizer.java | 131 ++--
.../kubernetes/ResourceUpdaterMatcher.java | 1 -
...BasedGenericKubernetesResourceMatcher.java | 175 ++++--
.../workflow/AbstractWorkflowExecutor.java | 59 +-
.../workflow/BaseWorkflowResult.java | 55 +-
.../CRDPresentActivationCondition.java | 23 +-
.../dependent/workflow/Condition.java | 11 +-
.../dependent/workflow/ConditionWithType.java | 7 +-
.../workflow/DefaultManagedWorkflow.java | 60 +-
.../dependent/workflow/DefaultWorkflow.java | 16 +-
.../DefaultWorkflowReconcileResult.java | 5 +-
.../workflow/DependentResourceNode.java | 33 +-
.../dependent/workflow/DetailedCondition.java | 28 +-
.../KubernetesResourceDeletedCondition.java | 6 +-
.../workflow/ManagedWorkflowFactory.java | 17 +-
.../workflow/ManagedWorkflowSupport.java | 72 ++-
.../dependent/workflow/NodeExecutor.java | 3 +-
.../dependent/workflow/WorkflowBuilder.java | 4 +-
.../workflow/WorkflowCleanupExecutor.java | 29 +-
.../workflow/WorkflowReconcileExecutor.java | 83 ++-
.../workflow/WorkflowReconcileResult.java | 4 +-
.../dependent/workflow/WorkflowResult.java | 25 +-
.../operator/processing/event/Event.java | 10 +-
.../processing/event/EventHandler.java | 1 -
.../processing/event/EventProcessor.java | 128 ++--
.../processing/event/EventSourceManager.java | 97 +--
.../event/EventSourceRetriever.java | 36 +-
.../processing/event/EventSources.java | 48 +-
.../event/PostExecutionControl.java | 3 +-
.../event/ReconciliationDispatcher.java | 219 ++++---
.../operator/processing/event/ResourceID.java | 30 +-
.../processing/event/ResourceState.java | 30 +-
.../event/ResourceStateManager.java | 1 -
.../event/rate/LinearRateLimiter.java | 11 +-
.../processing/event/rate/RateLimiter.java | 5 +-
.../event/source/AbstractEventSource.java | 8 +-
.../event/source/CacheKeyMapper.java | 1 -
.../processing/event/source/EventSource.java | 6 +-
.../source/EventSourceStartPriority.java | 9 +-
.../ExternalResourceCachingEventSource.java | 65 +-
.../source/PrimaryToSecondaryMapper.java | 30 +-
.../event/source/ResourceEventAware.java | 1 -
.../event/source/cache/BoundedCache.java | 1 -
.../event/source/cache/BoundedItemStore.java | 26 +-
.../cache/KubernetesResourceFetcher.java | 11 +-
.../event/source/cache/ResourceFetcher.java | 1 -
.../controller/ControllerEventSource.java | 20 +-
.../controller/InternalEventFilters.java | 10 +-
.../source/controller/ResourceAction.java | 4 +-
.../source/controller/ResourceEvent.java | 22 +-
.../event/source/filter/OnDeleteFilter.java | 11 +-
.../event/source/filter/OnUpdateFilter.java | 9 +-
.../inbound/CachingInboundEventSource.java | 6 +-
.../source/informer/InformerEventSource.java | 138 +++--
.../source/informer/InformerManager.java | 103 ++--
.../source/informer/InformerWrapper.java | 80 ++-
.../informer/ManagedInformerEventSource.java | 41 +-
.../event/source/informer/Mappers.java | 60 +-
.../informer/NOOPPrimaryToSecondaryIndex.java | 3 +-
.../informer/TemporaryResourceCache.java | 71 ++-
.../informer/TransformingItemStore.java | 4 +-
.../PerResourcePollingConfiguration.java | 45 +-
...erResourcePollingConfigurationBuilder.java | 9 +-
.../PerResourcePollingEventSource.java | 28 +-
.../source/polling/PollingConfiguration.java | 16 +-
.../polling/PollingConfigurationBuilder.java | 4 +-
.../source/polling/PollingEventSource.java | 18 +-
.../event/source/timer/TimerEventSource.java | 3 +-
.../processing/retry/GenericRetry.java | 7 +-
.../retry/GenericRetryExecution.java | 6 +-
.../processing/retry/GradualRetry.java | 6 +-
.../operator/processing/retry/Retry.java | 1 -
.../operator/ControllerManagerTest.java | 27 +-
.../operator/LeaderElectionManagerTest.java | 5 +-
.../operator/MockKubernetesClient.java | 41 +-
.../operator/OperatorTest.java | 1 -
.../operator/ReconcilerUtilsTest.java | 67 +-
.../javaoperatorsdk/operator/TestUtils.java | 1 -
.../operator/api/DeleteControlTest.java | 5 +-
.../ConfigurationServiceOverriderTest.java | 105 ++--
.../ControllerConfigurationOverriderTest.java | 163 +++--
.../api/config/InformerConfigurationTest.java | 52 +-
.../operator/api/config/UtilsTest.java | 22 +-
.../operator/api/config/VersionTest.java | 1 -
...dentResourceConfigurationResolverTest.java | 91 +--
.../api/reconciler/DefaultContextTest.java | 1 -
...ltManagedDependentResourceContextTest.java | 24 +-
.../operator/processing/ControllerTest.java | 31 +-
.../processing/GroupVersionKindTest.java | 10 +-
.../AbstractDependentResourceTest.java | 45 +-
.../dependent/EmptyTestDependentResource.java | 4 +-
.../GenericKubernetesResourceMatcherTest.java | 56 +-
.../GenericResourceUpdaterTest.java | 26 +-
.../ResourceRequirementsSanitizerTest.java | 228 ++++---
...dGenericKubernetesResourceMatcherTest.java | 92 ++-
.../AbstractWorkflowExecutorTest.java | 13 +-
.../workflow/BaseWorkflowResultTest.java | 18 +-
.../CRDPresentActivationConditionTest.java | 32 +-
.../dependent/workflow/ExecutionAssert.java | 8 +-
.../workflow/ManagedWorkflowSupportTest.java | 137 +++--
.../workflow/ManagedWorkflowTest.java | 63 +-
.../workflow/ManagedWorkflowTestUtils.java | 14 +-
.../workflow/WorkflowBuilderTest.java | 10 +-
.../workflow/WorkflowCleanupExecutorTest.java | 205 ++++---
.../WorkflowReconcileExecutorTest.java | 578 ++++++++++--------
.../dependent/workflow/WorkflowTest.java | 52 +-
.../processing/event/EventProcessorTest.java | 195 +++---
.../event/EventSourceManagerTest.java | 27 +-
.../processing/event/EventSourcesTest.java | 94 ++-
.../event/ReconciliationDispatcherTest.java | 318 +++++-----
.../event/ResourceStateManagerTest.java | 12 +-
.../event/rate/LinearRateLimiterTest.java | 1 -
.../source/AbstractEventSourceTestBase.java | 5 +-
...xternalResourceCachingEventSourceTest.java | 6 +-
.../event/source/SampleExternalResource.java | 6 +-
.../source/cache/BoundedItemStoreTest.java | 30 +-
.../cache/KubernetesResourceFetcherTest.java | 13 +-
.../controller/ControllerEventSourceTest.java | 43 +-
.../controller/InternalEventFiltersTest.java | 29 +-
.../CachingInboundEventSourceTest.java | 38 +-
.../informer/InformerEventSourceTest.java | 42 +-
.../event/source/informer/MappersTest.java | 19 +-
.../informer/PrimaryToSecondaryIndexTest.java | 9 +-
.../informer/TemporaryResourceCacheTest.java | 35 +-
.../informer/TransformingItemStoreTest.java | 37 +-
.../PerResourcePollingEventSourceTest.java | 169 ++---
.../polling/PollingEventSourceTest.java | 26 +-
.../source/timer/TimerEventSourceTest.java | 9 +-
.../ObservedGenCustomResource.java | 3 +-
.../observedgeneration/ObservedGenSpec.java | 4 +-
.../observedgeneration/ObservedGenStatus.java | 4 +-
.../simple/NamespacedTestCustomResource.java | 3 +-
.../sample/simple/TestCustomReconciler.java | 3 +-
.../simple/TestCustomReconcilerOtherV1.java | 4 +-
.../sample/simple/TestCustomResource.java | 1 -
.../simple/TestCustomResourceOtherV1.java | 4 +-
.../sample/simple/TestCustomResourceSpec.java | 5 +-
.../junit/AbstractOperatorExtension.java | 50 +-
.../ClusterDeployedOperatorExtension.java | 44 +-
.../junit/DefaultNamespaceNameSupplier.java | 18 +-
.../DefaultPerClassNamespaceNameSupplier.java | 3 +-
.../operator/junit/InClusterCurl.java | 50 +-
.../junit/LocallyRunOperatorExtension.java | 106 ++--
.../DefaultNamespaceNameSupplierTest.java | 13 +-
...aultPerClassNamespaceNameSupplierTest.java | 1 -
.../LocallyRunOperatorExtensionTest.java | 7 +-
.../junit/NamespaceNamingTestUtils.java | 17 +-
.../runtime/AccumulativeMappingWriter.java | 4 +-
.../config/runtime/ClassMappingProvider.java | 8 +-
...ollerConfigurationAnnotationProcessor.java | 4 +-
.../runtime/RuntimeControllerMetadata.java | 3 +-
.../config/runtime/TypeParameterResolver.java | 18 +-
.../operator/CRDMappingInTestExtensionIT.java | 30 +-
.../operator/IntegrationTestConstants.java | 1 -
.../operator/baseapi/ConcurrencyIT.java | 25 +-
.../baseapi/InformerErrorHandlerStartIT.java | 24 +-
.../baseapi/LeaderElectionPermissionIT.java | 41 +-
.../BuiltInResourceCleanerIT.java | 38 +-
.../BuiltInResourceCleanerReconciler.java | 7 +-
.../changenamespace/ChangeNamespaceIT.java | 52 +-
.../ChangeNamespaceTestCustomResource.java | 5 +-
.../ChangeNamespaceTestReconciler.java | 24 +-
.../CleanerForReconcilerCustomResource.java | 6 +-
.../CleanerForReconcilerIT.java | 42 +-
.../CleanerForReconcilerTestReconciler.java | 7 +-
.../CleanupConflictCustomResource.java | 5 +-
.../cleanupconflict/CleanupConflictIT.java | 26 +-
.../CleanupConflictReconciler.java | 7 +-
.../ClusterScopedCustomResource.java | 5 +-
...ClusterScopedCustomResourceReconciler.java | 46 +-
.../ClusterScopedResourceIT.java | 47 +-
...teUpdateEventFilterTestCustomResource.java | 7 +-
...dateEventFilterTestCustomResourceSpec.java | 1 -
...CreateUpdateEventFilterTestReconciler.java | 22 +-
...pdateInformerEventSourceEventFilterIT.java | 38 +-
.../PreviousAnnotationDisabledIT.java | 8 +-
.../deployment/DeploymentReconciler.java | 12 +-
.../KubernetesResourceStatusUpdateIT.java | 33 +-
...EventSourceRegistrationCustomResource.java | 7 +-
...namicGenericEventSourceRegistrationIT.java | 29 +-
...ericEventSourceRegistrationReconciler.java | 58 +-
.../ErrorStatusHandlerIT.java | 12 +-
.../ErrorStatusHandlerTestCustomResource.java | 3 +-
.../ErrorStatusHandlerTestReconciler.java | 12 +-
.../operator/baseapi/event/EventSourceIT.java | 9 +-
.../EventSourceTestCustomReconciler.java | 3 +-
.../event/EventSourceTestCustomResource.java | 3 +-
.../EventSourceTestCustomResourceStatus.java | 3 +-
.../operator/baseapi/filter/FilterIT.java | 57 +-
.../filter/FilterTestCustomResource.java | 3 +-
.../baseapi/filter/FilterTestReconciler.java | 33 +-
.../filter/FilterTestResourceStatus.java | 4 +-
.../operator/baseapi/filter/UpdateFilter.java | 3 +-
...ernetesResourceHandlingCustomResource.java | 4 +-
.../GenericKubernetesResourceHandlingIT.java | 5 +-
...cKubernetesResourceHandlingReconciler.java | 37 +-
.../baseapi/gracefulstop/GracefulStopIT.java | 58 +-
.../GracefulStopTestCustomResource.java | 4 +-
.../GracefulStopTestReconciler.java | 8 +-
.../InformerEventSourceIT.java | 26 +-
...formerEventSourceTestCustomReconciler.java | 8 +-
...InformerEventSourceTestCustomResource.java | 8 +-
.../InformerRemoteClusterCustomResource.java | 3 +-
.../InformerRemoteClusterIT.java | 65 +-
.../InformerRemoteClusterReconciler.java | 51 +-
.../labelselector/LabelSelectorIT.java | 29 +-
.../LabelSelectorTestCustomResource.java | 6 +-
.../LabelSelectorTestReconciler.java | 4 +-
...ElectionChangeNamespaceCustomResource.java | 6 +-
.../LeaderElectionChangeNamespaceIT.java | 55 +-
...aderElectionChangeNamespaceReconciler.java | 1 -
...anualObservedGenerationCustomResource.java | 3 +-
.../ManualObservedGenerationIT.java | 36 +-
.../ManualObservedGenerationReconciler.java | 15 +-
.../baseapi/maxinterval/MaxIntervalIT.java | 9 +-
.../MaxIntervalTestCustomResource.java | 6 +-
.../MaxIntervalTestReconciler.java | 6 +-
.../MaxIntervalAfterRetryIT.java | 11 +-
...xIntervalAfterRetryTestCustomResource.java | 6 +-
.../MaxIntervalAfterRetryTestReconciler.java | 6 +-
...tipleReconcilerSameTypeCustomResource.java | 4 +-
.../MultipleReconcilerSameTypeIT.java | 46 +-
...MultipleReconcilerSameTypeReconciler1.java | 1 -
...MultipleReconcilerSameTypeReconciler2.java | 1 -
...pleSecondaryEventSourceCustomResource.java | 6 +-
.../MultipleSecondaryEventSourceIT.java | 20 +-
...ultipleSecondaryEventSourceReconciler.java | 51 +-
.../multiversioncrd/MultiVersionCRDIT.java | 97 +--
.../MultiVersionCRDTestCustomResource1.java | 9 +-
.../MultiVersionCRDTestCustomResource2.java | 8 +-
...ultiVersionCRDTestCustomResourceSpec1.java | 1 -
.../MultiVersionCRDTestReconciler1.java | 3 +-
.../MultiVersionCRDTestReconciler2.java | 3 +-
...tReconciliationImminentCustomResource.java | 7 +-
.../NextReconciliationImminentIT.java | 24 +-
.../NextReconciliationImminentReconciler.java | 3 +-
...hResourceAndStatusNoSSACustomResource.java | 3 +-
.../PatchResourceAndStatusNoSSAIT.java | 23 +-
.../PatchResourceAndStatusNoSSAStatus.java | 3 +-
.../PatchResourceAndStatusWithSSAIT.java | 1 -
...tchResourceAndStatusWithSSAReconciler.java | 14 +-
.../PatchResourceWithSSACustomResource.java | 4 +-
.../PatchResourceWithSSAIT.java | 3 -
.../PatchResourceWithSSAReconciler.java | 14 +-
.../PatchWithSSAITBase.java | 46 +-
.../PerResourceEventSourceCustomResource.java | 6 +-
.../PerResourcePollingEventSourceIT.java | 21 +-
...ourcePollingEventSourceTestReconciler.java | 22 +-
.../AbstractPrimaryIndexerTestReconciler.java | 5 +-
.../primaryindexer/PrimaryIndexerIT.java | 6 +-
.../PrimaryIndexerTestCustomResource.java | 7 +-
...rimaryIndexerTestCustomResourceStatus.java | 6 +-
.../PrimaryIndexerTestReconciler.java | 23 +-
.../baseapi/primarytosecondary/Cluster.java | 5 +-
.../baseapi/primarytosecondary/Job.java | 5 +-
.../primarytosecondary/JobReconciler.java | 59 +-
.../PrimaryToSecondaryIT.java | 19 +-
.../PrimaryToSecondaryMissingIT.java | 21 +-
.../ratelimit/RateLimitCustomResource.java | 7 +-
.../RateLimitCustomResourceStatus.java | 4 +-
.../baseapi/ratelimit/RateLimitIT.java | 53 +-
.../ratelimit/RateLimitReconciler.java | 9 +-
.../operator/baseapi/retry/RetryIT.java | 39 +-
.../baseapi/retry/RetryMaxAttemptIT.java | 8 +-
.../retry/RetryTestCustomReconciler.java | 8 +-
.../retry/RetryTestCustomResource.java | 3 +-
.../retry/RetryTestCustomResourceStatus.java | 3 +-
.../baseapi/simple/ReconcilerExecutorIT.java | 15 +-
.../baseapi/simple/TestCustomResource.java | 3 +-
.../baseapi/simple/TestReconciler.java | 33 +-
.../StatusPatchLockingCustomResource.java | 8 +-
.../StatusPatchLockingReconciler.java | 4 +-
.../StatusPatchNotLockingForNonSSAIT.java | 54 +-
.../StatusPatchSSAMigrationIT.java | 141 +++--
.../StatusUpdateLockingCustomResource.java | 5 +-
.../StatusUpdateLockingIT.java | 27 +-
.../StatusUpdateLockingReconciler.java | 1 -
.../SubResourceTestCustomReconciler.java | 4 +-
.../SubResourceTestCustomResource.java | 3 +-
.../SubResourceTestCustomResourceStatus.java | 3 +-
.../subresource/SubResourceUpdateIT.java | 20 +-
...modifiableDependentPartCustomResource.java | 5 +-
.../UnmodifiableDependentPartIT.java | 34 +-
.../UnmodifiableDependentPartReconciler.java | 1 -
.../UnmodifiablePartConfigMapDependent.java | 31 +-
...sInCleanupAndRescheduleCustomResource.java | 7 +-
...tusInCleanupAndRescheduleCustomStatus.java | 1 -
.../UpdateStatusInCleanupAndRescheduleIT.java | 41 +-
...tatusInCleanupAndRescheduleReconciler.java | 5 +-
.../config/BaseConfigurationServiceTest.java | 160 ++---
.../DefaultConfigurationServiceTest.java | 7 +-
.../config/runtime/TestCustomResource.java | 3 +-
.../bulkdependent/BulkDependentDeleterIT.java | 3 +-
.../bulkdependent/BulkDependentTestBase.java | 58 +-
.../BulkDependentTestCustomResource.java | 4 +-
.../CRUDConfigMapBulkDependentResource.java | 3 +-
...ConfigMapDeleterBulkDependentResource.java | 36 +-
.../BulkDependentWithConditionIT.java | 35 +-
...DependentWithReadyConditionReconciler.java | 21 +-
.../condition/SampleBulkCondition.java | 8 +-
.../external/BulkExternalDependentIT.java | 17 +-
.../ExternalBulkDependentResource.java | 76 ++-
.../external/ExternalResource.java | 6 +-
.../managed/ManagedBulkDependentIT.java | 4 +-
.../ManagedBulkDependentReconciler.java | 7 +-
.../managed/ManagedDeleterBulkReconciler.java | 3 +-
.../readonly/ReadOnlyBulkDependentIT.java | 41 +-
.../ReadOnlyBulkDependentResource.java | 21 +-
.../ReadOnlyBulkReadyPostCondition.java | 3 +-
.../readonly/ReadOnlyBulkReconciler.java | 21 +-
.../standalone/StandaloneBulkDependentIT.java | 3 +-
.../StandaloneBulkDependentReconciler.java | 3 +-
...anerForManagedDependentCustomResource.java | 6 +-
...nerForManagedDependentResourcesOnlyIT.java | 21 +-
...anerForManagedDependentTestReconciler.java | 4 +-
.../ConfigMapDependentResource.java | 14 +-
.../ConfigMapDependentResource.java | 17 +-
...xistingDependentWithSSACustomResource.java | 4 +-
...teOnlyIfNotExistingDependentWithSSAIT.java | 27 +-
...NotExistingDependentWithSSAReconciler.java | 6 +-
.../DependentAnnotationSecondaryMapperIT.java | 12 +-
...ntAnnotationSecondaryMapperReconciler.java | 27 +-
...dentAnnotationSecondaryMapperResource.java | 6 +-
...stomMappingConfigMapDependentResource.java | 28 +-
.../DependentCustomMappingAnnotationIT.java | 34 +-
.../DependentCustomMappingCustomResource.java | 5 +-
.../DependentCustomMappingReconciler.java | 5 +-
.../ConfigMapDependentResource.java | 8 +-
...ndentDifferentNamespaceCustomResource.java | 4 +-
.../DependentDifferentNamespaceIT.java | 44 +-
...DependentDifferentNamespaceReconciler.java | 11 +-
.../dependentfilter/DependentFilterIT.java | 36 +-
.../DependentFilterTestCustomResource.java | 3 +-
.../FilteredDependentConfigMap.java | 12 +-
.../dependentfilter/UpdateFilter.java | 3 +-
.../ConfigMapDependentResource.java | 8 +-
...entOperationEventFilterCustomResource.java | 3 +-
...entFilterCustomResourceTestReconciler.java | 11 +-
.../DependentOperationEventFilterIT.java | 29 +-
.../ConfigMapDependentResource.java | 12 +-
...pendentReInitializationCustomResource.java | 7 +-
.../DependentReInitializationIT.java | 9 +-
.../DependentReInitializationReconciler.java | 8 +-
.../DependentResourceCrossRefIT.java | 9 +-
.../DependentResourceCrossRefReconciler.java | 56 +-
.../DependentResourceCrossRefResource.java | 6 +-
.../DependentSSACustomResource.java | 6 +-
.../dependentssa/DependentSSAMatchingIT.java | 98 +--
.../dependentssa/DependentSSAMigrationIT.java | 116 ++--
.../dependentssa/DependentSSAReconciler.java | 11 +-
.../dependentssa/SSAConfigMapDependent.java | 21 +-
.../ExternalStateCustomResource.java | 6 +-
.../ExternalStateDependentIT.java | 3 +-
.../ExternalStateDependentReconciler.java | 17 +-
.../externalstate/ExternalStateIT.java | 45 +-
.../ExternalStateReconciler.java | 112 ++--
.../externalstate/ExternalStateTestBase.java | 43 +-
.../ExternalWithStateDependentResource.java | 65 +-
...ulkDependentResourceExternalWithState.java | 76 ++-
...ernalStateBulkDependentCustomResource.java | 4 +-
.../ExternalStateBulkDependentReconciler.java | 15 +-
.../ExternalStateBulkIT.java | 72 ++-
.../GenericKubernetesDependentTestBase.java | 39 +-
.../ConfigMapGenericKubernetesDependent.java | 11 +-
...ernetesDependentManagedCustomResource.java | 4 +-
.../GenericKubernetesDependentManagedIT.java | 5 +-
...cKubernetesDependentManagedReconciler.java | 1 -
.../ConfigMapGenericKubernetesDependent.java | 12 +-
...etesDependentStandaloneCustomResource.java | 4 +-
...enericKubernetesDependentStandaloneIT.java | 4 +-
...bernetesDependentStandaloneReconciler.java | 5 +-
.../ConfigMapDependentResource.java | 15 +-
.../InformerRelatedBehaviorITS.java | 225 ++++---
...rmerRelatedBehaviorTestCustomResource.java | 6 +-
...InformerRelatedBehaviorTestReconciler.java | 9 +-
...ntGarbageCollectionTestCustomResource.java | 6 +-
...endentGarbageCollectionTestReconciler.java | 23 +-
...ubernetesDependentGarbageCollectionIT.java | 55 +-
.../MultipleDependentResourceConfigMap.java | 3 +-
...ltipleDependentResourceCustomResource.java | 4 +-
.../MultipleDependentResourceIT.java | 53 +-
.../MultipleDependentResourceReconciler.java | 8 +-
.../MultipleDependentResourceConfigMap.java | 7 +-
...ResourceCustomResourceNoDiscriminator.java | 3 +-
...ntResourceWithDiscriminatorReconciler.java | 20 +-
...ependentResourceWithNoDiscriminatorIT.java | 31 +-
...tipleDependentSameTypeMultiInformerIT.java | 52 +-
...endentResourceMultiInformerConfigMap1.java | 7 +-
...endentResourceMultiInformerConfigMap2.java | 7 +-
...ntResourceMultiInformerCustomResource.java | 4 +-
...endentResourceMultiInformerReconciler.java | 18 +-
...gedDependentNoDiscriminatorConfigMap1.java | 14 +-
...gedDependentNoDiscriminatorConfigMap2.java | 7 +-
...ependentNoDiscriminatorCustomResource.java | 4 +-
...ipleManagedDependentNoDiscriminatorIT.java | 88 ++-
...dentSameTypeNoDiscriminatorReconciler.java | 27 +-
...pleManagedDependentResourceConfigMap1.java | 7 +-
...pleManagedDependentResourceConfigMap2.java | 7 +-
...anagedDependentResourceCustomResource.java | 5 +-
...pleManagedDependentResourceReconciler.java | 22 +-
.../MultipleManagedDependentSameTypeIT.java | 53 +-
.../AbstractExternalDependentResource.java | 28 +-
...ternalDependentResourceCustomResource.java | 5 +-
...edExternalDependentResourceReconciler.java | 58 +-
...pleManagedExternalDependentSameTypeIT.java | 27 +-
.../MultiOwnerDependentTriggeringIT.java | 57 +-
.../MultipleOwnerDependentConfigMap.java | 13 +-
.../MultipleOwnerDependentCustomResource.java | 5 +-
.../MultipleOwnerDependentReconciler.java | 9 +-
...DependentPrimaryIndexerTestReconciler.java | 38 +-
.../ConfigMapDependent.java | 16 +-
.../ConfigMapReconcilePrecondition.java | 11 +-
...aryToSecondaryDependentCustomResource.java | 4 +-
.../PrimaryToSecondaryDependentIT.java | 40 +-
...PrimaryToSecondaryDependentReconciler.java | 73 ++-
.../SecretDependent.java | 18 +-
.../dependent/readonly/ConfigMapReader.java | 3 +-
.../restart/ConfigMapDependentResource.java | 16 +-
.../dependent/restart/OperatorRestartIT.java | 19 +-
.../restart/RestartTestCustomResource.java | 5 +-
.../restart/RestartTestReconciler.java | 4 +-
.../ServiceDependentResource.java | 24 +-
.../ServiceStrictMatcherIT.java | 39 +-
...erviceStrictMatcherTestCustomResource.java | 5 +-
.../ServiceStrictMatcherTestReconciler.java | 1 -
.../ServiceAccountDependentResource.java | 18 +-
.../SpecialResourceCustomResource.java | 3 +-
.../SpecialResourceTestReconciler.java | 17 +-
.../SpecialResourcesDependentIT.java | 33 +-
.../SSALegacyMatcherCustomResource.java | 7 +-
.../SSALegacyMatcherReconciler.java | 6 +-
.../SSAWithLegacyMatcherIT.java | 28 +-
.../ServiceDependentResource.java | 28 +-
.../StandaloneDependentResourceIT.java | 8 +-
...StandaloneDependentTestCustomResource.java | 5 +-
.../StandaloneDependentTestReconciler.java | 17 +-
...efulSetDesiredSanitizerCustomResource.java | 5 +-
...lSetDesiredSanitizerDependentResource.java | 23 +-
.../StatefulSetDesiredSanitizerIT.java | 24 +-
...StatefulSetDesiredSanitizerReconciler.java | 3 +-
.../support/ExternalIDGenServiceMock.java | 3 +-
.../operator/support/ExternalResource.java | 19 +-
.../operator/support/TestUtils.java | 4 +-
.../ComplexWorkflowCustomResource.java | 3 +-
.../complexdependent/ComplexWorkflowIT.java | 49 +-
.../ComplexWorkflowReconciler.java | 62 +-
.../ComplexWorkflowStatus.java | 1 -
.../dependent/BaseService.java | 11 +-
.../dependent/BaseStatefulSet.java | 11 +-
.../dependent/FirstService.java | 1 -
.../dependent/FirstStatefulSet.java | 1 -
.../dependent/SecondStatefulSet.java | 1 -
.../dependent/StatefulSetReadyCondition.java | 11 +-
.../CRDPresentActivationConditionIT.java | 54 +-
.../CRDPresentActivationCustomResource.java | 8 +-
.../CRDPresentActivationDependent.java | 13 +-
...sentActivationDependentCustomResource.java | 5 +-
.../CRDPresentActivationReconciler.java | 15 +-
.../ConfigMapDependentResource.java | 13 +-
.../GetNonActiveSecondaryCustomResource.java | 8 +-
.../RouteDependentResource.java | 12 +-
.../WorkflowActivationConditionIT.java | 18 +-
...WorkflowActivationConditionReconciler.java | 12 +-
.../ConfigMapDependent.java | 8 +-
...tDefaultDeleteConditionCustomResource.java | 6 +-
...ndentDefaultDeleteConditionReconciler.java | 14 +-
.../ManagedDependentDeleteConditionIT.java | 53 +-
.../SecretDependent.java | 13 +-
.../ConfigMapDependentResource1.java | 16 +-
.../ConfigMapDependentResource2.java | 16 +-
...ipleDependentActivationCustomResource.java | 6 +-
...MultipleDependentActivationReconciler.java | 17 +-
.../MultipleDependentWithActivationIT.java | 69 ++-
.../SecretDependentResource.java | 17 +-
.../ConfigMapDependentResource1.java | 11 +-
.../ConfigMapDependentResource2.java | 11 +-
...OrderedManagedDependentCustomResource.java | 6 +-
.../OrderedManagedDependentIT.java | 13 +-
...OrderedManagedDependentTestReconciler.java | 16 +-
.../ConfigMapDependentResource.java | 16 +-
...rkflowActivationCleanupCustomResource.java | 6 +-
.../WorkflowActivationCleanupIT.java | 49 +-
.../WorkflowActivationCleanupReconciler.java | 15 +-
.../ConfigMapDependentResource.java | 12 +-
.../RouteDependentResource.java | 12 +-
...flowActivationConditionCustomResource.java | 6 +-
.../WorkflowActivationConditionIT.java | 17 +-
...WorkflowActivationConditionReconciler.java | 12 +-
.../ConfigMapDependentResource.java | 34 +-
.../ConfigMapReconcileCondition.java | 3 +-
.../DeploymentDependentResource.java | 12 +-
.../DeploymentReadyCondition.java | 13 +-
.../WorkflowAllFeatureCustomResource.java | 6 +-
.../WorkflowAllFeatureIT.java | 124 ++--
.../WorkflowAllFeatureReconciler.java | 44 +-
.../ConfigMapDependent.java | 16 +-
...WorkflowExplicitCleanupCustomResource.java | 6 +-
.../WorkflowExplicitCleanupIT.java | 21 +-
.../WorkflowExplicitCleanupReconciler.java | 8 +-
.../ConfigMapDependent.java | 17 +-
...kflowExplicitInvocationCustomResource.java | 4 +-
.../WorkflowExplicitInvocationIT.java | 34 +-
.../WorkflowExplicitInvocationReconciler.java | 4 +-
.../ConfigMapDependentResource.java | 16 +-
.../SecretDependentResource.java | 17 +-
...kflowMultipleActivationCustomResource.java | 6 +-
.../WorkflowMultipleActivationIT.java | 123 ++--
.../WorkflowMultipleActivationReconciler.java | 12 +-
.../ConfigMapDependent.java | 9 +-
...wExceptionsInReconcilerCustomResource.java | 6 +-
...kflowExceptionsInReconcilerReconciler.java | 25 +-
.../WorkflowSilentExceptionHandlingIT.java | 21 +-
pom.xml | 77 +--
...rollerNamespaceDeletionCustomResource.java | 4 +-
.../ControllerNamespaceDeletionOperator.java | 22 +-
...ControllerNamespaceDeletionReconciler.java | 18 +-
.../ControllerNamespaceDeletionSpec.java | 1 -
.../ControllerNamespaceDeletionStatus.java | 1 -
.../ControllerNamespaceDeletionE2E.java | 91 +--
.../sample/LeaderElectionTestReconciler.java | 7 +-
.../operator/sample/LeaderElectionE2E.java | 157 +++--
.../operator/sample/MySQLDbConfig.java | 9 +-
.../operator/sample/MySQLSchema.java | 3 +-
.../operator/sample/MySQLSchemaOperator.java | 19 +-
.../sample/MySQLSchemaReconciler.java | 62 +-
.../dependent/ResourcePollerConfig.java | 1 -
.../dependent/SchemaDependentResource.java | 51 +-
.../dependent/SecretDependentResource.java | 13 +-
.../operator/sample/schema/Schema.java | 11 +-
.../operator/sample/schema/SchemaService.java | 32 +-
.../sample/MySQLSchemaOperatorE2E.java | 15 +-
.../sample/DeploymentDependentResource.java | 55 +-
.../sample/ServiceDependentResource.java | 5 +-
.../operator/sample/TomcatReconciler.java | 40 +-
.../operator/sample/Webapp.java | 4 +-
.../operator/sample/WebappReconciler.java | 77 ++-
.../operator/sample/TomcatOperatorE2E.java | 96 +--
.../operator/sample/Utils.java | 21 +-
.../WebPageDependentsWorkflowReconciler.java | 55 +-
.../WebPageManagedDependentsReconciler.java | 31 +-
.../operator/sample/WebPageOperator.java | 4 +-
.../operator/sample/WebPageReconciler.java | 77 ++-
...WebPageStandaloneDependentsReconciler.java | 22 +-
.../sample/customresource/WebPage.java | 8 +-
.../sample/customresource/WebPageSpec.java | 4 +-
.../sample/customresource/WebPageStatus.java | 16 +-
.../DeploymentDependentResource.java | 10 +-
.../ExposedIngressCondition.java | 6 +-
.../IngressDependentResource.java | 1 -
.../ServiceDependentResource.java | 6 +-
.../sample/WebPageOperatorAbstractTest.java | 51 +-
.../operator/sample/WebPageOperatorE2E.java | 22 +-
...eOperatorManagedDependentResourcesE2E.java | 21 +-
663 files changed, 9630 insertions(+), 8333 deletions(-)
delete mode 100644 contributing/eclipse-google-style.xml
delete mode 100644 contributing/eclipse.importorder
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 81afad78b8..797938cf3c 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,5 @@
{
- "java.format.settings.url": "contributing/eclipse-google-style.xml",
+ "java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
"java.completion.importOrder": [
"java",
"javax",
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index facbbd7df9..c3a9e63545 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -62,10 +62,10 @@ The SDK modules and samples are formatted to follow the Java Google code style.
On every `compile` the code gets formatted automatically,
however, to make things simpler (i.e. avoid getting a PR rejected simply because of code style issues), you can import one of the following code style schemes based on the IDE you use:
-- for *IntelliJ IDEA*:
- - Install the [Eclipse Code Formatter plugin](https://github.com/krasa/EclipseCodeFormatter#instructions)
- - Use [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml) for the Eclipse formatter config file
-- for *Eclipse* import [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml)
+- for *Intellij IDEA*
+ install [google-java-format](https://plugins.jetbrains.com/plugin/8527-google-java-format) plugin
+- for *Eclipse*
+ follow [these intructions](https://github.com/google/google-java-format?tab=readme-ov-file#eclipse)
## Thanks
diff --git a/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/Bootstrapper.java b/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/Bootstrapper.java
index ed12e7619d..7339d7e9aa 100644
--- a/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/Bootstrapper.java
+++ b/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/Bootstrapper.java
@@ -27,8 +27,7 @@ public class Bootstrapper {
private static final Map TOP_LEVEL_STATIC_FILES =
Map.of("_.gitignore", ".gitignore", "README.md", "README.md");
private static final List JAVA_FILES =
- List.of("CustomResource.java", "Reconciler.java",
- "Spec.java", "Status.java");
+ List.of("CustomResource.java", "Reconciler.java", "Spec.java", "Status.java");
public void create(File targetDir, String groupId, String artifactId) {
try {
@@ -61,19 +60,24 @@ private void addJavaFiles(File projectDir, String groupId, String artifactId) {
var targetTestDir = new File(projectDir, "src/test/java/" + packages);
FileUtils.forceMkdir(targetDir);
var classFileNamePrefix = artifactClassId(artifactId);
- JAVA_FILES.forEach(f -> addTemplatedFile(projectDir, f, groupId, artifactId, targetDir,
- classFileNamePrefix + f));
+ JAVA_FILES.forEach(
+ f ->
+ addTemplatedFile(
+ projectDir, f, groupId, artifactId, targetDir, classFileNamePrefix + f));
addTemplatedFile(projectDir, "Runner.java", groupId, artifactId, targetDir, null);
- addTemplatedFile(projectDir, "ConfigMapDependentResource.java", groupId, artifactId,
- targetDir, null);
- addTemplatedFile(projectDir, "ReconcilerIntegrationTest.java", groupId,
+ addTemplatedFile(
+ projectDir, "ConfigMapDependentResource.java", groupId, artifactId, targetDir, null);
+ addTemplatedFile(
+ projectDir,
+ "ReconcilerIntegrationTest.java",
+ groupId,
artifactId,
- targetTestDir, artifactClassId(artifactId) + "ReconcilerIntegrationTest.java");
+ targetTestDir,
+ artifactClassId(artifactId) + "ReconcilerIntegrationTest.java");
} catch (IOException e) {
throw new RuntimeException(e);
}
-
}
private void addTemplatedFiles(File projectDir, String groupId, String artifactId) {
@@ -81,22 +85,37 @@ private void addTemplatedFiles(File projectDir, String groupId, String artifactI
addTemplatedFile(projectDir, "k8s/test-resource.yaml", groupId, artifactId);
}
- private void addTemplatedFile(File projectDir, String fileName, String groupId,
- String artifactId) {
+ private void addTemplatedFile(
+ File projectDir, String fileName, String groupId, String artifactId) {
addTemplatedFile(projectDir, fileName, groupId, artifactId, null, null);
}
- private void addTemplatedFile(File projectDir, String fileName, String groupId, String artifactId,
- File targetDir, String targetFileName) {
+ private void addTemplatedFile(
+ File projectDir,
+ String fileName,
+ String groupId,
+ String artifactId,
+ File targetDir,
+ String targetFileName) {
try {
- var values = Map.of("groupId", groupId, "artifactId", artifactId,
- "artifactClassId", artifactClassId(artifactId),
- "josdkVersion", Versions.JOSDK,
- "fabric8Version", Versions.KUBERNETES_CLIENT);
+ var values =
+ Map.of(
+ "groupId",
+ groupId,
+ "artifactId",
+ artifactId,
+ "artifactClassId",
+ artifactClassId(artifactId),
+ "josdkVersion",
+ Versions.JOSDK,
+ "fabric8Version",
+ Versions.KUBERNETES_CLIENT);
var mustache = mustacheFactory.compile("templates/" + fileName);
- var targetFile = new File(targetDir == null ? projectDir : targetDir,
- targetFileName == null ? fileName : targetFileName);
+ var targetFile =
+ new File(
+ targetDir == null ? projectDir : targetDir,
+ targetFileName == null ? fileName : targetFileName);
FileUtils.forceMkdir(targetFile.getParentFile());
var writer = new FileWriter(targetFile);
mustache.execute(writer, values);
@@ -114,8 +133,8 @@ private void addStaticFile(File targetDir, String fileName, String targetFileNam
addStaticFile(targetDir, fileName, targetFileName, null);
}
- private void addStaticFile(File targetDir, String fileName, String targetFilename,
- String subDir) {
+ private void addStaticFile(
+ File targetDir, String fileName, String targetFilename, String subDir) {
String sourcePath = subDir == null ? "/static/" : "/static/" + subDir;
String path = sourcePath + fileName;
try (var is = Bootstrapper.class.getResourceAsStream(path)) {
@@ -127,14 +146,12 @@ private void addStaticFile(File targetDir, String fileName, String targetFilenam
} catch (IOException e) {
throw new RuntimeException("File path: " + path, e);
}
-
}
public static String artifactClassId(String artifactId) {
var parts = artifactId.split("-");
- return Arrays.stream(parts).map(p -> p.substring(0, 1)
- .toUpperCase() + p.substring(1))
+ return Arrays.stream(parts)
+ .map(p -> p.substring(0, 1).toUpperCase() + p.substring(1))
.collect(Collectors.joining(""));
}
-
}
diff --git a/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/BootstrapperMojo.java b/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/BootstrapperMojo.java
index 0d87a152e2..cb470f7e87 100644
--- a/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/BootstrapperMojo.java
+++ b/bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/BootstrapperMojo.java
@@ -8,8 +8,7 @@
import org.apache.maven.plugins.annotations.Parameter;
@Mojo(name = "create", requiresProject = false)
-public class BootstrapperMojo
- extends AbstractMojo {
+public class BootstrapperMojo extends AbstractMojo {
@Parameter(defaultValue = "${projectGroupId}")
protected String projectGroupId;
@@ -17,8 +16,7 @@ public class BootstrapperMojo
@Parameter(defaultValue = "${projectArtifactId}")
protected String projectArtifactId;
- public void execute()
- throws MojoExecutionException {
+ public void execute() throws MojoExecutionException {
String userDir = System.getProperty("user.dir");
new Bootstrapper().create(new File(userDir), projectGroupId, projectArtifactId);
}
diff --git a/bootstrapper-maven-plugin/src/test/java/io/javaoperatorsdk/bootstrapper/BootstrapperTest.java b/bootstrapper-maven-plugin/src/test/java/io/javaoperatorsdk/bootstrapper/BootstrapperTest.java
index 0fde63059a..f7840c1585 100644
--- a/bootstrapper-maven-plugin/src/test/java/io/javaoperatorsdk/bootstrapper/BootstrapperTest.java
+++ b/bootstrapper-maven-plugin/src/test/java/io/javaoperatorsdk/bootstrapper/BootstrapperTest.java
@@ -30,9 +30,11 @@ void copiesFilesToTarget() {
private void assertProjectCompiles() {
try {
- var process = Runtime.getRuntime()
- .exec(
- "mvn clean install -f target/test-project/pom.xml -DskipTests -Dspotless.apply.skip");
+ var process =
+ Runtime.getRuntime()
+ .exec(
+ "mvn clean install -f target/test-project/pom.xml -DskipTests"
+ + " -Dspotless.apply.skip");
BufferedReader stdOut = new BufferedReader(new InputStreamReader(process.getInputStream()));
diff --git a/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCache.java b/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCache.java
index af4a17e2c2..c7ac96cb20 100644
--- a/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCache.java
+++ b/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCache.java
@@ -2,9 +2,7 @@
import com.github.benmanes.caffeine.cache.Cache;
-/**
- * Caffeine cache wrapper to be used in a {@link BoundedItemStore}
- */
+/** Caffeine cache wrapper to be used in a {@link BoundedItemStore} */
public class CaffeineBoundedCache implements BoundedCache {
private final Cache cache;
diff --git a/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedItemStores.java b/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedItemStores.java
index a58d58bd2a..89fbcef70f 100644
--- a/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedItemStores.java
+++ b/caffeine-bounded-cache-support/src/main/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedItemStores.java
@@ -9,9 +9,9 @@
import com.github.benmanes.caffeine.cache.Caffeine;
/**
- * A factory for Caffeine-backed
- * {@link BoundedItemStore}. The implementation uses a {@link CaffeineBoundedCache} to store
- * resources and progressively evict them if they haven't been used in a while. The idea about
+ * A factory for Caffeine-backed {@link
+ * BoundedItemStore}. The implementation uses a {@link CaffeineBoundedCache} to store resources and
+ * progressively evict them if they haven't been used in a while. The idea about
* CaffeinBoundedItemStore-s is that, caffeine will cache the resources which were recently used,
* and will evict resource, which are not used for a while. This is ideal for startup performance
* and efficiency when all resources should be cached to avoid undue load on the API server. This is
@@ -20,11 +20,11 @@
* happen that some / many of these resources are then seldom or even reconciled anymore. In that
* situation, large amounts of memory might be consumed to cache resources that are never used
* again.
- *
- * Note that if a resource is reconciled and is not present anymore in cache, it will transparently
- * be fetched again from the API server. Similarly, since associated secondary resources are usually
- * reconciled too, they might need to be fetched and populated to the cache, and will remain there
- * for some time, for subsequent reconciliations.
+ *
+ *
Note that if a resource is reconciled and is not present anymore in cache, it will
+ * transparently be fetched again from the API server. Similarly, since associated secondary
+ * resources are usually reconciled too, they might need to be fetched and populated to the cache,
+ * and will remain there for some time, for subsequent reconciliations.
*/
public class CaffeineBoundedItemStores {
@@ -39,11 +39,8 @@ private CaffeineBoundedItemStores() {}
*/
@SuppressWarnings("unused")
public static BoundedItemStore boundedItemStore(
- KubernetesClient client, Class rClass,
- Duration accessExpireDuration) {
- Cache cache = Caffeine.newBuilder()
- .expireAfterAccess(accessExpireDuration)
- .build();
+ KubernetesClient client, Class rClass, Duration accessExpireDuration) {
+ Cache cache = Caffeine.newBuilder().expireAfterAccess(accessExpireDuration).build();
return boundedItemStore(client, rClass, cache);
}
@@ -51,5 +48,4 @@ public static BoundedItemStore boundedItemStore(
KubernetesClient client, Class rClass, Cache cache) {
return new BoundedItemStore<>(new CaffeineBoundedCache<>(cache), rClass, client);
}
-
}
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/BoundedCacheTestBase.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/BoundedCacheTestBase.java
index 21adf81cc0..05d31a7479 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/BoundedCacheTestBase.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/BoundedCacheTestBase.java
@@ -17,7 +17,8 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
-public abstract class BoundedCacheTestBase> {
+public abstract class BoundedCacheTestBase<
+ P extends CustomResource> {
private static final Logger log = LoggerFactory.getLogger(BoundedCacheTestBase.class);
@@ -42,34 +43,46 @@ void reconciliationWorksWithLimitedCache() {
}
private void assertConfigMapsDeleted() {
- await().atMost(Duration.ofSeconds(30))
- .untilAsserted(() -> IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST).forEach(i -> {
- var cm = extension().get(ConfigMap.class, RESOURCE_NAME_PREFIX + i);
- assertThat(cm).isNull();
- }));
+ await()
+ .atMost(Duration.ofSeconds(30))
+ .untilAsserted(
+ () ->
+ IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST)
+ .forEach(
+ i -> {
+ var cm = extension().get(ConfigMap.class, RESOURCE_NAME_PREFIX + i);
+ assertThat(cm).isNull();
+ }));
}
private void deleteTestResources() {
- IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST).forEach(i -> {
- var cm = extension().get(customResourceClass(), RESOURCE_NAME_PREFIX + i);
- var deleted = extension().delete(cm);
- if (!deleted) {
- log.warn("Custom resource might not be deleted: {}", cm);
- }
- });
+ IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST)
+ .forEach(
+ i -> {
+ var cm = extension().get(customResourceClass(), RESOURCE_NAME_PREFIX + i);
+ var deleted = extension().delete(cm);
+ if (!deleted) {
+ log.warn("Custom resource might not be deleted: {}", cm);
+ }
+ });
}
private void updateTestResources() {
- IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST).forEach(i -> {
- var cm = extension().get(ConfigMap.class, RESOURCE_NAME_PREFIX + i);
- cm.getData().put(DATA_KEY, UPDATED_PREFIX + i);
- extension().replace(cm);
- });
+ IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST)
+ .forEach(
+ i -> {
+ var cm = extension().get(ConfigMap.class, RESOURCE_NAME_PREFIX + i);
+ cm.getData().put(DATA_KEY, UPDATED_PREFIX + i);
+ extension().replace(cm);
+ });
}
void assertConfigMapData(String dataPrefix) {
- await().untilAsserted(() -> IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST)
- .forEach(i -> assertConfigMap(i, dataPrefix)));
+ await()
+ .untilAsserted(
+ () ->
+ IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST)
+ .forEach(i -> assertConfigMap(i, dataPrefix)));
}
private void assertConfigMap(int i, String prefix) {
@@ -79,9 +92,11 @@ private void assertConfigMap(int i, String prefix) {
}
private void createTestResources() {
- IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST).forEach(i -> {
- extension().create(createTestResource(i));
- });
+ IntStream.range(0, NUMBER_OF_RESOURCE_TO_TEST)
+ .forEach(
+ i -> {
+ extension().create(createTestResource(i));
+ });
}
abstract P createTestResource(int index);
@@ -89,7 +104,4 @@ private void createTestResources() {
abstract Class customResourceClass();
abstract LocallyRunOperatorExtension extension();
-
-
-
}
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheClusterScopeIT.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheClusterScopeIT.java
index 252b20f4a4..0c16c1227b 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheClusterScopeIT.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheClusterScopeIT.java
@@ -19,21 +19,22 @@ public class CaffeineBoundedCacheClusterScopeIT
@RegisterExtension
LocallyRunOperatorExtension extension =
LocallyRunOperatorExtension.builder()
- .withReconciler(new BoundedCacheClusterScopeTestReconciler(), o -> {
- o.withItemStore(boundedItemStore(
- new KubernetesClientBuilder().build(),
- BoundedCacheClusterScopeTestCustomResource.class,
- Duration.ofMinutes(1),
- 1));
- })
+ .withReconciler(
+ new BoundedCacheClusterScopeTestReconciler(),
+ o -> {
+ o.withItemStore(
+ boundedItemStore(
+ new KubernetesClientBuilder().build(),
+ BoundedCacheClusterScopeTestCustomResource.class,
+ Duration.ofMinutes(1),
+ 1));
+ })
.build();
@Override
BoundedCacheClusterScopeTestCustomResource createTestResource(int index) {
var res = new BoundedCacheClusterScopeTestCustomResource();
- res.setMetadata(new ObjectMetaBuilder()
- .withName(RESOURCE_NAME_PREFIX + index)
- .build());
+ res.setMetadata(new ObjectMetaBuilder().withName(RESOURCE_NAME_PREFIX + index).build());
res.setSpec(new BoundedCacheTestSpec());
res.getSpec().setData(INITIAL_DATA_PREFIX + index);
res.getSpec().setTargetNamespace(extension.getNamespace());
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheNamespacedIT.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheNamespacedIT.java
index ae7f8f5873..534d7b2027 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheNamespacedIT.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/CaffeineBoundedCacheNamespacedIT.java
@@ -18,19 +18,22 @@ class CaffeineBoundedCacheNamespacedIT
@RegisterExtension
LocallyRunOperatorExtension extension =
- LocallyRunOperatorExtension.builder().withReconciler(new BoundedCacheTestReconciler(), o -> {
- o.withItemStore(boundedItemStore(
- new KubernetesClientBuilder().build(), BoundedCacheTestCustomResource.class,
- Duration.ofMinutes(1),
- 1));
- })
+ LocallyRunOperatorExtension.builder()
+ .withReconciler(
+ new BoundedCacheTestReconciler(),
+ o -> {
+ o.withItemStore(
+ boundedItemStore(
+ new KubernetesClientBuilder().build(),
+ BoundedCacheTestCustomResource.class,
+ Duration.ofMinutes(1),
+ 1));
+ })
.build();
BoundedCacheTestCustomResource createTestResource(int index) {
var res = new BoundedCacheTestCustomResource();
- res.setMetadata(new ObjectMetaBuilder()
- .withName(RESOURCE_NAME_PREFIX + index)
- .build());
+ res.setMetadata(new ObjectMetaBuilder().withName(RESOURCE_NAME_PREFIX + index).build());
res.setSpec(new BoundedCacheTestSpec());
res.getSpec().setData(INITIAL_DATA_PREFIX + index);
res.getSpec().setTargetNamespace(extension.getNamespace());
@@ -46,5 +49,4 @@ Class customResourceClass() {
LocallyRunOperatorExtension extension() {
return extension;
}
-
}
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/AbstractTestReconciler.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/AbstractTestReconciler.java
index 10ab50138a..b059ac033b 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/AbstractTestReconciler.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/AbstractTestReconciler.java
@@ -28,7 +28,8 @@
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
-public abstract class AbstractTestReconciler>
+public abstract class AbstractTestReconciler<
+ P extends CustomResource>
implements Reconciler {
private static final Logger log =
@@ -37,9 +38,7 @@ public abstract class AbstractTestReconciler
reconcile(
- P resource,
- Context
context) {
+ public UpdateControl
reconcile(P resource, Context
context) {
var maybeConfigMap = context.getSecondaryResource(ConfigMap.class);
maybeConfigMap.ifPresentOrElse(
cm -> updateConfigMapIfNeeded(cm, resource, context),
@@ -58,33 +57,39 @@ protected void updateConfigMapIfNeeded(ConfigMap cm, P resource, Context
cont
}
protected void createConfigMap(P resource, Context
context) {
- var cm = new ConfigMapBuilder()
- .withMetadata(new ObjectMetaBuilder()
- .withName(resource.getMetadata().getName())
- .withNamespace(resource.getSpec().getTargetNamespace())
- .build())
- .withData(Map.of(DATA_KEY, resource.getSpec().getData()))
- .build();
+ var cm =
+ new ConfigMapBuilder()
+ .withMetadata(
+ new ObjectMetaBuilder()
+ .withName(resource.getMetadata().getName())
+ .withNamespace(resource.getSpec().getTargetNamespace())
+ .build())
+ .withData(Map.of(DATA_KEY, resource.getSpec().getData()))
+ .build();
cm.addOwnerReference(resource);
context.getClient().configMaps().resource(cm).create();
}
@Override
- public List> prepareEventSources(
- EventSourceContext context) {
+ public List> prepareEventSources(EventSourceContext context) {
var boundedItemStore =
- boundedItemStore(new KubernetesClientBuilder().build(),
- ConfigMap.class, Duration.ofMinutes(1), 1); // setting max size for testing purposes
-
- var es = new InformerEventSource<>(
- InformerEventSourceConfiguration.from(ConfigMap.class, primaryClass())
- .withItemStore(boundedItemStore)
- .withSecondaryToPrimaryMapper(
- Mappers.fromOwnerReferences(context.getPrimaryResourceClass(),
- this instanceof BoundedCacheClusterScopeTestReconciler))
- .build(),
- context);
+ boundedItemStore(
+ new KubernetesClientBuilder().build(),
+ ConfigMap.class,
+ Duration.ofMinutes(1),
+ 1); // setting max size for testing purposes
+
+ var es =
+ new InformerEventSource<>(
+ InformerEventSourceConfiguration.from(ConfigMap.class, primaryClass())
+ .withItemStore(boundedItemStore)
+ .withSecondaryToPrimaryMapper(
+ Mappers.fromOwnerReferences(
+ context.getPrimaryResourceClass(),
+ this instanceof BoundedCacheClusterScopeTestReconciler))
+ .build(),
+ context);
return List.of(es);
}
@@ -96,17 +101,18 @@ private void ensureStatus(P resource) {
}
public static BoundedItemStore boundedItemStore(
- KubernetesClient client, Class rClass,
+ KubernetesClient client,
+ Class rClass,
Duration accessExpireDuration,
// max size is only for testing purposes
long cacheMaxSize) {
- Cache cache = Caffeine.newBuilder()
- .expireAfterAccess(accessExpireDuration)
- .maximumSize(cacheMaxSize)
- .build();
+ Cache cache =
+ Caffeine.newBuilder()
+ .expireAfterAccess(accessExpireDuration)
+ .maximumSize(cacheMaxSize)
+ .build();
return CaffeineBoundedItemStores.boundedItemStore(client, rClass, cache);
}
protected abstract Class primaryClass();
-
}
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestCustomResource.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestCustomResource.java
index a77416715e..6fc9a5babc 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestCustomResource.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestCustomResource.java
@@ -11,5 +11,4 @@
@Version("v1")
@ShortNames("bccs")
public class BoundedCacheClusterScopeTestCustomResource
- extends CustomResource {
-}
+ extends CustomResource {}
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestReconciler.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestReconciler.java
index 84448fc9d8..93f103cbf2 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestReconciler.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/clusterscope/BoundedCacheClusterScopeTestReconciler.java
@@ -4,8 +4,8 @@
import io.javaoperatorsdk.operator.processing.event.source.cache.sample.AbstractTestReconciler;
@ControllerConfiguration
-public class BoundedCacheClusterScopeTestReconciler extends
- AbstractTestReconciler {
+public class BoundedCacheClusterScopeTestReconciler
+ extends AbstractTestReconciler {
@Override
protected Class primaryClass() {
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestCustomResource.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestCustomResource.java
index a5e37917ba..9b77aa7bf8 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestCustomResource.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestCustomResource.java
@@ -10,5 +10,4 @@
@Version("v1")
@ShortNames("bct")
public class BoundedCacheTestCustomResource
- extends CustomResource implements Namespaced {
-}
+ extends CustomResource implements Namespaced {}
diff --git a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestStatus.java b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestStatus.java
index 2bdd434d23..5aa5ca2258 100644
--- a/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestStatus.java
+++ b/caffeine-bounded-cache-support/src/test/java/io/javaoperatorsdk/operator/processing/event/source/cache/sample/namespacescope/BoundedCacheTestStatus.java
@@ -1,4 +1,3 @@
package io.javaoperatorsdk.operator.processing.event.source.cache.sample.namespacescope;
-public class BoundedCacheTestStatus {
-}
+public class BoundedCacheTestStatus {}
diff --git a/contributing/eclipse-google-style.xml b/contributing/eclipse-google-style.xml
deleted file mode 100644
index 64340b1054..0000000000
--- a/contributing/eclipse-google-style.xml
+++ /dev/null
@@ -1,337 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/contributing/eclipse.importorder b/contributing/eclipse.importorder
deleted file mode 100644
index 8a156041e9..0000000000
--- a/contributing/eclipse.importorder
+++ /dev/null
@@ -1,7 +0,0 @@
-0=java
-1=javax
-2=org
-3=io
-4=com
-5=
-6=\#
diff --git a/docs/content/en/docs/contributing/_index.md b/docs/content/en/docs/contributing/_index.md
index e67c45ebb6..dfe6dec99c 100644
--- a/docs/content/en/docs/contributing/_index.md
+++ b/docs/content/en/docs/contributing/_index.md
@@ -72,9 +72,9 @@ avoid getting a PR rejected simply because of code style issues), you can import
following code style schemes based on the IDE you use:
- for *Intellij IDEA*
- import [contributing/intellij-google-style.xml](contributing/intellij-google-style.xml)
+ install [google-java-format](https://plugins.jetbrains.com/plugin/8527-google-java-format) plugin
- for *Eclipse*
- import [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml)
+ follow [these intructions](https://github.com/google/google-java-format?tab=readme-ov-file#eclipse)
## Thanks
diff --git a/micrometer-support/src/main/java/io/javaoperatorsdk/operator/monitoring/micrometer/MicrometerMetrics.java b/micrometer-support/src/main/java/io/javaoperatorsdk/operator/monitoring/micrometer/MicrometerMetrics.java
index 07106d9b3c..26f149249b 100644
--- a/micrometer-support/src/main/java/io/javaoperatorsdk/operator/monitoring/micrometer/MicrometerMetrics.java
+++ b/micrometer-support/src/main/java/io/javaoperatorsdk/operator/monitoring/micrometer/MicrometerMetrics.java
@@ -89,8 +89,8 @@ public static MicrometerMetricsBuilder newMicrometerMetricsBuilder(MeterRegistry
* @return a MicrometerMetrics instance configured to not collect per-resource metrics
* @see PerResourceCollectingMicrometerMetricsBuilder
*/
- public static PerResourceCollectingMicrometerMetricsBuilder newPerResourceCollectingMicrometerMetricsBuilder(
- MeterRegistry registry) {
+ public static PerResourceCollectingMicrometerMetricsBuilder
+ newPerResourceCollectingMicrometerMetricsBuilder(MeterRegistry registry) {
return new PerResourceCollectingMicrometerMetricsBuilder(registry);
}
@@ -103,8 +103,8 @@ public static PerResourceCollectingMicrometerMetricsBuilder newPerResourceCollec
* @param cleaner the {@link Cleaner} to use
* @param collectingPerResourceMetrics whether to collect per resource metrics
*/
- private MicrometerMetrics(MeterRegistry registry, Cleaner cleaner,
- boolean collectingPerResourceMetrics) {
+ private MicrometerMetrics(
+ MeterRegistry registry, Cleaner cleaner, boolean collectingPerResourceMetrics) {
this.registry = registry;
this.cleaner = cleaner;
this.collectPerResourceMetrics = collectingPerResourceMetrics;
@@ -144,17 +144,17 @@ public T timeControllerExecution(ControllerExecution execution) {
.publishPercentileHistogram()
.register(registry);
try {
- final var result = timer.record(() -> {
- try {
- return execution.execute();
- } catch (Exception e) {
- throw new OperatorException(e);
- }
- });
+ final var result =
+ timer.record(
+ () -> {
+ try {
+ return execution.execute();
+ } catch (Exception e) {
+ throw new OperatorException(e);
+ }
+ });
final var successType = execution.successTypeName(result);
- registry
- .counter(execName + SUCCESS_SUFFIX, CONTROLLER, name, TYPE, successType)
- .increment();
+ registry.counter(execName + SUCCESS_SUFFIX, CONTROLLER, name, TYPE, successType).increment();
return result;
} catch (Exception e) {
final var exception = e.getClass().getSimpleName();
@@ -168,12 +168,16 @@ public T timeControllerExecution(ControllerExecution execution) {
@Override
public void receivedEvent(Event event, Map metadata) {
if (event instanceof ResourceEvent) {
- incrementCounter(event.getRelatedCustomResourceID(), EVENTS_RECEIVED,
+ incrementCounter(
+ event.getRelatedCustomResourceID(),
+ EVENTS_RECEIVED,
metadata,
Tag.of(EVENT, event.getClass().getSimpleName()),
Tag.of(ACTION, ((ResourceEvent) event).getAction().toString()));
} else {
- incrementCounter(event.getRelatedCustomResourceID(), EVENTS_RECEIVED,
+ incrementCounter(
+ event.getRelatedCustomResourceID(),
+ EVENTS_RECEIVED,
metadata,
Tag.of(EVENT, event.getClass().getSimpleName()));
}
@@ -187,14 +191,18 @@ public void cleanupDoneFor(ResourceID resourceID, Map metadata)
}
@Override
- public void reconcileCustomResource(HasMetadata resource, RetryInfo retryInfoNullable,
- Map metadata) {
+ public void reconcileCustomResource(
+ HasMetadata resource, RetryInfo retryInfoNullable, Map metadata) {
Optional retryInfo = Optional.ofNullable(retryInfoNullable);
- incrementCounter(ResourceID.fromResource(resource), RECONCILIATIONS_STARTED,
+ incrementCounter(
+ ResourceID.fromResource(resource),
+ RECONCILIATIONS_STARTED,
metadata,
- Tag.of(RECONCILIATIONS_RETRIES_NUMBER,
+ Tag.of(
+ RECONCILIATIONS_RETRIES_NUMBER,
String.valueOf(retryInfo.map(RetryInfo::getAttemptCount).orElse(0))),
- Tag.of(RECONCILIATIONS_RETRIES_LAST,
+ Tag.of(
+ RECONCILIATIONS_RETRIES_LAST,
String.valueOf(retryInfo.map(RetryInfo::isLastAttempt).orElse(true))));
var controllerQueueSize =
@@ -226,15 +234,18 @@ public void reconciliationExecutionFinished(HasMetadata resource, Map metadata) {
+ public void failedReconciliation(
+ HasMetadata resource, Exception exception, Map metadata) {
var cause = exception.getCause();
if (cause == null) {
cause = exception;
} else if (cause instanceof RuntimeException) {
cause = cause.getCause() != null ? cause.getCause() : cause;
}
- incrementCounter(ResourceID.fromResource(resource), RECONCILIATIONS_FAILED, metadata,
+ incrementCounter(
+ ResourceID.fromResource(resource),
+ RECONCILIATIONS_FAILED,
+ metadata,
Tag.of(EXCEPTION, cause.getClass().getSimpleName()));
}
@@ -243,9 +254,8 @@ public void failedReconciliation(HasMetadata resource, Exception exception,
return registry.gaugeMapSize(PREFIX + name + SIZE_SUFFIX, Collections.emptyList(), map);
}
-
- private void addMetadataTags(ResourceID resourceID, Map metadata,
- List tags, boolean prefixed) {
+ private void addMetadataTags(
+ ResourceID resourceID, Map metadata, List tags, boolean prefixed) {
if (collectPerResourceMetrics) {
addTag(NAME, resourceID.getName(), tags, prefixed);
addTagOmittingOnEmptyValue(NAMESPACE, resourceID.getNamespace().orElse(null), tags, prefixed);
@@ -261,8 +271,8 @@ private static void addTag(String name, String value, List tags, boolean pr
tags.add(Tag.of(getPrefixedMetadataTag(name, prefixed), value));
}
- private static void addTagOmittingOnEmptyValue(String name, String value, List tags,
- boolean prefixed) {
+ private static void addTagOmittingOnEmptyValue(
+ String name, String value, List tags, boolean prefixed) {
if (value != null && !value.isBlank()) {
addTag(name, value, tags, prefixed);
}
@@ -282,8 +292,8 @@ private static void addGVKTags(GroupVersionKind gvk, List tags, boolean pre
addTag(KIND, gvk.getKind(), tags, prefixed);
}
- private void incrementCounter(ResourceID id, String counterName, Map metadata,
- Tag... additionalTags) {
+ private void incrementCounter(
+ ResourceID id, String counterName, Map metadata, Tag... additionalTags) {
final var additionalTagsNb =
additionalTags != null && additionalTags.length > 0 ? additionalTags.length : 0;
final var metadataNb = metadata != null ? metadata.size() : 0;
@@ -314,8 +324,8 @@ private PerResourceCollectingMicrometerMetricsBuilder(MeterRegistry registry) {
/**
* @param cleaningThreadsNumber the maximal number of threads that can be assigned to the
- * removal of {@link Meter}s associated with deleted resources, defaults to 1 if not
- * specified or if the provided number is lesser or equal to 0
+ * removal of {@link Meter}s associated with deleted resources, defaults to 1 if not
+ * specified or if the provided number is lesser or equal to 0
*/
public PerResourceCollectingMicrometerMetricsBuilder withCleaningThreadNumber(
int cleaningThreadsNumber) {
@@ -325,11 +335,11 @@ public PerResourceCollectingMicrometerMetricsBuilder withCleaningThreadNumber(
/**
* @param cleanUpDelayInSeconds the number of seconds to wait before {@link Meter}s are removed
- * for deleted resources, defaults to 1 (meaning meters will be removed one second after
- * the associated resource is deleted) if not specified or if the provided number is
- * lesser than 0. Threading and the general interaction model of interacting with the API
- * server means that it's not possible to ensure that meters are immediately deleted in
- * all cases so a minimal delay of one second is always enforced
+ * for deleted resources, defaults to 1 (meaning meters will be removed one second after the
+ * associated resource is deleted) if not specified or if the provided number is lesser than
+ * 0. Threading and the general interaction model of interacting with the API server means
+ * that it's not possible to ensure that meters are immediately deleted in all cases so a
+ * minimal delay of one second is always enforced
*/
public PerResourceCollectingMicrometerMetricsBuilder withCleanUpDelayInSeconds(
int cleanUpDelayInSeconds) {
@@ -344,6 +354,7 @@ public MicrometerMetrics build() {
return new MicrometerMetrics(registry, cleaner, true);
}
}
+
public static class MicrometerMetricsBuilder {
protected final MeterRegistry registry;
private boolean collectingPerResourceMetrics = true;
@@ -352,9 +363,7 @@ private MicrometerMetricsBuilder(MeterRegistry registry) {
this.registry = registry;
}
- /**
- * Configures the instance to collect metrics on a per-resource basis.
- */
+ /** Configures the instance to collect metrics on a per-resource basis. */
@SuppressWarnings("unused")
public PerResourceCollectingMicrometerMetricsBuilder collectingMetricsPerResource() {
collectingPerResourceMetrics = true;
@@ -422,8 +431,8 @@ static class DelayedCleaner extends MicrometerMetrics.DefaultCleaner {
private final ScheduledExecutorService metersCleaner;
private final int cleanUpDelayInSeconds;
- private DelayedCleaner(MeterRegistry registry, int cleanUpDelayInSeconds,
- int cleaningThreadsNumber) {
+ private DelayedCleaner(
+ MeterRegistry registry, int cleanUpDelayInSeconds, int cleaningThreadsNumber) {
super(registry);
this.cleanUpDelayInSeconds = cleanUpDelayInSeconds;
this.metersCleaner = Executors.newScheduledThreadPool(cleaningThreadsNumber);
@@ -432,8 +441,8 @@ private DelayedCleaner(MeterRegistry registry, int cleanUpDelayInSeconds,
@Override
public void removeMetersFor(ResourceID resourceID) {
// schedule deletion of meters associated with ResourceID
- metersCleaner.schedule(() -> super.removeMetersFor(resourceID),
- cleanUpDelayInSeconds, TimeUnit.SECONDS);
+ metersCleaner.schedule(
+ () -> super.removeMetersFor(resourceID), cleanUpDelayInSeconds, TimeUnit.SECONDS);
}
}
}
diff --git a/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/AbstractMicrometerMetricsTestFixture.java b/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/AbstractMicrometerMetricsTestFixture.java
index 8575f07243..788253e5e8 100644
--- a/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/AbstractMicrometerMetricsTestFixture.java
+++ b/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/AbstractMicrometerMetricsTestFixture.java
@@ -25,7 +25,6 @@ public abstract class AbstractMicrometerMetricsTestFixture {
protected final MicrometerMetrics metrics = getMetrics();
protected static final String testResourceName = "micrometer-metrics-cr";
-
@RegisterExtension
LocallyRunOperatorExtension operator =
LocallyRunOperatorExtension.builder()
@@ -33,21 +32,23 @@ public abstract class AbstractMicrometerMetricsTestFixture {
.withReconciler(new MetricsCleaningTestReconciler())
.build();
-
protected abstract MicrometerMetrics getMetrics();
@Test
void properlyHandlesResourceDeletion() throws Exception {
- var testResource = new ConfigMapBuilder()
- .withNewMetadata()
- .withName(testResourceName)
- .endMetadata()
- .build();
+ var testResource =
+ new ConfigMapBuilder().withNewMetadata().withName(testResourceName).endMetadata().build();
final var created = operator.create(testResource);
// make sure the resource is created
- await().until(() -> !operator.get(ConfigMap.class, testResourceName)
- .getMetadata().getFinalizers().isEmpty());
+ await()
+ .until(
+ () ->
+ !operator
+ .get(ConfigMap.class, testResourceName)
+ .getMetadata()
+ .getFinalizers()
+ .isEmpty());
final var resourceID = ResourceID.fromResource(created);
final var meters = preDeleteChecks(resourceID);
diff --git a/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/DelayedMetricsCleaningOnDeleteIT.java b/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/DelayedMetricsCleaningOnDeleteIT.java
index 26dfe59f84..92929d5ddb 100644
--- a/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/DelayedMetricsCleaningOnDeleteIT.java
+++ b/micrometer-support/src/test/java/io/javaoperatorsdk/operator/monitoring/micrometer/DelayedMetricsCleaningOnDeleteIT.java
@@ -15,7 +15,9 @@ public class DelayedMetricsCleaningOnDeleteIT extends AbstractMicrometerMetricsT
@Override
protected MicrometerMetrics getMetrics() {
return MicrometerMetrics.newPerResourceCollectingMicrometerMetricsBuilder(registry)
- .withCleanUpDelayInSeconds(testDelay).withCleaningThreadNumber(2).build();
+ .withCleanUpDelayInSeconds(testDelay)
+ .withCleaningThreadNumber(2)
+ .build();
}
@Override
diff --git a/operator-framework-bom/pom.xml b/operator-framework-bom/pom.xml
index 7f1617c457..d0bae9c140 100644
--- a/operator-framework-bom/pom.xml
+++ b/operator-framework-bom/pom.xml
@@ -78,25 +78,34 @@
com.diffplug.spotless
spotless-maven-plugin
- ${spotless.version}