[ 
https://issues.apache.org/jira/browse/FLINK-38548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gyula Fora closed FLINK-38548.
------------------------------
    Fix Version/s: kubernetes-operator-1.14.0
       Resolution: Fixed

merged to main 98d041d90dfbf06573bce407cc0fc492d828c6e3

> Blue/Green Deployments rename too many spec fields
> --------------------------------------------------
>
>                 Key: FLINK-38548
>                 URL: https://issues.apache.org/jira/browse/FLINK-38548
>             Project: Flink
>          Issue Type: Bug
>          Components: Kubernetes Operator
>            Reporter: Prem Santosh
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: kubernetes-operator-1.14.0
>
>
> Hi [~gyfora] and [~schongloo], thanks so much for contributing FLINK-38420.
> In our initial testing of the feature, we found that the adjustNameReferences 
> method blanket replaces all occurrences of the deployment name in the spec 
> with a suffixed version of the name with -blue or -green: 
> [https://github.com/apache/flink-kubernetes-operator/blob/main/flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/bluegreen/BlueGreenUtils.java#L62-L81]
> {code:java}
>     public static <T> T adjustNameReferences(
>             T spec,
>             String deploymentName,
>             String childDeploymentName,
>             String wrapperKey,
>             Class<T> valueType) {
>         String serializedSpec = SpecUtils.writeSpecAsJSON(spec, wrapperKey);
>         String replacedSerializedSpec = 
> serializedSpec.replace(deploymentName, childDeploymentName);
>         return SpecUtils.readSpecFromJSON(replacedSerializedSpec, wrapperKey, 
> valueType);
>     }
> {code}
> We use the deployment name in various fields such as metrics scope, 
> checkpoint and savepoint directories, and even configmap names in the 
> taskmanager and jobmanager pod templates. The blanket replacement breaks 
> operations such as restoring the deployment from savepoint since the 
> initialSavepointPath field also gets rewriten.
> We would like to submit a patch to remove the call to adjustNameReferences, 
> and change only the child deployment names to include the blue/green suffixes 
> if possible. Creating a Jira ticket first per the contributor guide.
> Sharing the code change we'll submit as a PR upstream if the contributors 
> agree: [https://github.com/lyft/flink-kubernetes-operator/pull/1/files]
> Thanks!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to