wangyang0918 commented on a change in pull request #14629:
URL: https://github.com/apache/flink/pull/14629#discussion_r582060108



##########
File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitJobManagerDecorator.java
##########
@@ -60,14 +60,14 @@ public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
                 new PodBuilder(flinkPod.getPod())
                         .withApiVersion(API_VERSION)
                         .editOrNewMetadata()
-                        .withLabels(kubernetesJobManagerParameters.getLabels())
-                        
.withAnnotations(kubernetesJobManagerParameters.getAnnotations())
+                        
.addToLabels(kubernetesJobManagerParameters.getLabels())
+                        
.addToAnnotations(kubernetesJobManagerParameters.getAnnotations())
                         .endMetadata()
                         .editOrNewSpec()
                         
.withServiceAccountName(kubernetesJobManagerParameters.getServiceAccount())

Review comment:
       When I design the pod template at the very begging, I have a simple rule 
that pod template is used to configure the advanced features(e.g. init 
container, sidecar container, volumes, etc) which we have not supported via 
config options. So if a Kubernetes feature has a corresponding config option, 
the users should use it. If it is not explicitly configured, the default value 
will take effect. This will force the users to make the pod template as simple 
as possible.
   
   This is just my idea. Your suggestion about the precedence also makes sense. 
I will have a try on this. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to