Skip to content

Commit 091e803

Browse files
authored
[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 a10fb45 / #834
1 parent d9e8cce commit 091e803

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,6 @@ public static <SPEC extends AbstractFlinkSpec> void updateReconciliationMetadata
546546
var lastSpecWithMeta = reconciliationStatus.deserializeLastReconciledSpecWithMeta();
547547
var newMeta = ReconciliationMetadata.from(resource);
548548

549-
if (newMeta.equals(lastSpecWithMeta.getMeta())) {
550-
// Nothing to update
551-
return;
552-
}
553-
554549
reconciliationStatus.setLastReconciledSpec(
555550
SpecUtils.writeSpecWithMeta(lastSpecWithMeta.getSpec(), newMeta));
556551
resource.getStatus().setObservedGeneration(resource.getMetadata().getGeneration());

flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconcilerTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,10 +1235,6 @@ public void testUpgradeReconciledGeneration() throws Exception {
12351235
// Submit no-op upgrade
12361236
deployment.getSpec().getFlinkConfiguration().put("kubernetes.operator.test", "value");
12371237
deployment.getMetadata().setGeneration(2L);
1238-
deployment
1239-
.getStatus()
1240-
.getReconciliationStatus()
1241-
.serializeAndSetLastReconciledSpec(deployment.getSpec(), deployment);
12421238

12431239
reconciler.reconcile(deployment, context);
12441240
assertEquals(2L, deployment.getStatus().getObservedGeneration());

0 commit comments

Comments
 (0)