You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by mx...@apache.org on 2024/12/11 17:04:16 UTC
(flink-kubernetes-operator) branch main updated: [FLINK-36890] Update observedGeneration on NOOP reconciliation (#923)
This is an automated email from the ASF dual-hosted git repository.
mxm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 091e803a [FLINK-36890] Update observedGeneration on NOOP reconciliation (#923)
091e803a is described below
commit 091e803a6ae713ebe839742694ab6ca53249c4dd
Author: Maximilian Michels <mx...@apache.org>
AuthorDate: Wed Dec 11 18:04:10 2024 +0100
[FLINK-36890] Update observedGeneration on NOOP reconciliation (#923)
The observedGeneration field wasn't updated anymore when the spec update results
in a NOOP reconciliation.
This is a regression of a10fb4501011be4e88fb6164156e3b9e8527950e /
https://github.com/apache/flink-kubernetes-operator/pull/834
---
.../flink/kubernetes/operator/reconciler/ReconciliationUtils.java | 5 -----
.../operator/reconciler/deployment/ApplicationReconcilerTest.java | 4 ----
2 files changed, 9 deletions(-)
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java
index 8dba93bc..37e2bde9 100644
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java
+++ b/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java
@@ -546,11 +546,6 @@ public class ReconciliationUtils {
var lastSpecWithMeta = reconciliationStatus.deserializeLastReconciledSpecWithMeta();
var newMeta = ReconciliationMetadata.from(resource);
- if (newMeta.equals(lastSpecWithMeta.getMeta())) {
- // Nothing to update
- return;
- }
-
reconciliationStatus.setLastReconciledSpec(
SpecUtils.writeSpecWithMeta(lastSpecWithMeta.getSpec(), newMeta));
resource.getStatus().setObservedGeneration(resource.getMetadata().getGeneration());
diff --git a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconcilerTest.java b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconcilerTest.java
index 2c236b68..34a71d3b 100644
--- a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconcilerTest.java
+++ b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconcilerTest.java
@@ -1235,10 +1235,6 @@ public class ApplicationReconcilerTest extends OperatorTestBase {
// Submit no-op upgrade
deployment.getSpec().getFlinkConfiguration().put("kubernetes.operator.test", "value");
deployment.getMetadata().setGeneration(2L);
- deployment
- .getStatus()
- .getReconciliationStatus()
- .serializeAndSetLastReconciledSpec(deployment.getSpec(), deployment);
reconciler.reconcile(deployment, context);
assertEquals(2L, deployment.getStatus().getObservedGeneration());