Skip to content

Commit 20a0e7f

Browse files
committed
Change only child flinkdeployment name for bluegreen
1 parent 3e3cb58 commit 20a0e7f

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/bluegreen/BlueGreenUtils.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,13 @@ public static FlinkDeployment prepareFlinkDeployment(
346346
String childDeploymentName =
347347
bgMeta.getName() + "-" + blueGreenDeploymentType.toString().toLowerCase();
348348

349-
FlinkBlueGreenDeploymentSpec adjustedSpec =
350-
adjustNameReferences(
351-
spec,
352-
bgMeta.getName(),
353-
childDeploymentName,
354-
"spec",
355-
FlinkBlueGreenDeploymentSpec.class);
356-
357349
// The Blue/Green initialSavepointPath is only used for first-time deployments
358350
if (isFirstDeployment) {
359351
String initialSavepointPath =
360-
adjustedSpec.getTemplate().getSpec().getJob().getInitialSavepointPath();
352+
spec.getTemplate().getSpec().getJob().getInitialSavepointPath();
361353
if (initialSavepointPath != null && !initialSavepointPath.isEmpty()) {
362354
LOG.info("Using initialSavepointPath: " + initialSavepointPath);
363-
adjustedSpec
364-
.getTemplate()
355+
spec.getTemplate()
365356
.getSpec()
366357
.getJob()
367358
.setInitialSavepointPath(initialSavepointPath);
@@ -371,10 +362,10 @@ public static FlinkDeployment prepareFlinkDeployment(
371362
} else if (lastCheckpoint != null) {
372363
String location = lastCheckpoint.getLocation().replace("file:", "");
373364
LOG.info("Using Blue/Green savepoint/checkpoint: " + location);
374-
adjustedSpec.getTemplate().getSpec().getJob().setInitialSavepointPath(location);
365+
spec.getTemplate().getSpec().getJob().setInitialSavepointPath(location);
375366
}
376367

377-
flinkDeployment.setSpec(adjustedSpec.getTemplate().getSpec());
368+
flinkDeployment.setSpec(spec.getTemplate().getSpec());
378369

379370
// Deployment metadata
380371
ObjectMeta flinkDeploymentMeta = getDependentObjectMeta(context.getBgDeployment());

0 commit comments

Comments
 (0)