Grypse commented on code in PR #20516:
URL: https://github.com/apache/flink/pull/20516#discussion_r943264068


##########
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/utils/KubernetesUtils.java:
##########
@@ -419,12 +420,18 @@ public static FlinkPod loadPodFromTemplateFile(
         final List<Container> otherContainers = new ArrayList<>();
         Container mainContainer = null;
 
-        for (Container container : 
pod.getInternalResource().getSpec().getContainers()) {
-            if (mainContainerName.equals(container.getName())) {
-                mainContainer = container;
-            } else {
-                otherContainers.add(container);
+        if (null != pod.getInternalResource().getSpec()) {
+            for (Container container : 
pod.getInternalResource().getSpec().getContainers()) {
+                if (mainContainerName.equals(container.getName())) {
+                    mainContainer = container;
+                } else {
+                    otherContainers.add(container);
+                }
             }
+            pod.getInternalResource().getSpec().setContainers(otherContainers);
+        } else {
+            // Set empty spec for taskmanager pod template

Review Comment:
   Fixed.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to