azagrebin commented on a change in pull request #11245:
URL: https://github.com/apache/flink/pull/11245#discussion_r441598028
##########
File path:
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
##########
@@ -137,11 +138,17 @@
.withDescription("The cluster-id, which should be no more than
45 characters, is used for identifying " +
"a unique Flink cluster. If not set, the client will
automatically generate it with a random ID.");
+ // The default container image that ties to the exact needed versions
of both Flink and Scala.
+ public static final String DEFAULT_CONTAINER_IMAGE = "flink:" +
EnvironmentInformation.getVersion() + "-scala_" +
EnvironmentInformation.getScalaVersion();
+
public static final ConfigOption<String> CONTAINER_IMAGE =
key("kubernetes.container.image")
.stringType()
- .defaultValue("flink:latest")
- .withDescription("Image to use for Flink containers.");
+ .defaultValue(DEFAULT_CONTAINER_IMAGE)
+ .withDescription("Image to use for Flink containers. " +
+ "The specified image MUST be based upon Apache Flink " +
+ EnvironmentInformation.getVersion() + " that uses Scala
" + EnvironmentInformation.getScalaVersion() + " . " +
Review comment:
This default value in code is mostly for documentation purposes in this
case:
```
DEFAULT_CONTAINER_IMAGE = "flink:" + EnvironmentInformation.getVersion(); //
no scala
```
As I mentioned before, I do not see any value in having Scala version in the
default value to avoid confusing 'flip flop'. We cannot provide a custom
computation for option default value on runtime, so it will be w/o runtime
Scala version for user code (if it decides to check it from option) which is
not a big problem imo.
The option description should describe the real behaviour for the default
value in runtime, also for documentation purposes:
```
.defaultValue("flink:" + EnvironmentInformation.getVersion())
.withDescription("Image to use for Flink containers. If you do not configure
it then ... runtime Scala version ...
```
For implementation: `configuration.contains` checks whether user explicitly
configured the option to append the runtime Scala version for the real default
image tag.
##########
File path:
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/configuration/KubernetesConfigOptions.java
##########
@@ -137,11 +138,17 @@
.withDescription("The cluster-id, which should be no more than
45 characters, is used for identifying " +
"a unique Flink cluster. If not set, the client will
automatically generate it with a random ID.");
+ // The default container image that ties to the exact needed versions
of both Flink and Scala.
+ public static final String DEFAULT_CONTAINER_IMAGE = "flink:" +
EnvironmentInformation.getVersion() + "-scala_" +
EnvironmentInformation.getScalaVersion();
+
public static final ConfigOption<String> CONTAINER_IMAGE =
key("kubernetes.container.image")
.stringType()
- .defaultValue("flink:latest")
- .withDescription("Image to use for Flink containers.");
+ .defaultValue(DEFAULT_CONTAINER_IMAGE)
+ .withDescription("Image to use for Flink containers. " +
+ "The specified image MUST be based upon Apache Flink " +
+ EnvironmentInformation.getVersion() + " that uses Scala
" + EnvironmentInformation.getScalaVersion() + " . " +
Review comment:
This default value in code is mostly for documentation purposes in this
case:
```
DEFAULT_CONTAINER_IMAGE = "flink:" + EnvironmentInformation.getVersion(); //
no scala
```
As I mentioned before, I do not see any value in having Scala version in the
default value to avoid confusing 'flip flop'. We cannot provide a custom
computation for option default value on runtime, so it will be w/o runtime
Scala version for user code (if it decides to check it from option) which is
not a big problem imo.
The option description should describe the real behaviour for the default
value in runtime, also for documentation purposes:
```
.defaultValue("flink:" + EnvironmentInformation.getVersion())
.withDescription("Image to use for Flink containers. If you do not configure
it then ... runtime Scala version ...
```
For implementation: `configuration.contains` checks whether user explicitly
configured the option to append the runtime Scala version to the real default
image tag.
----------------------------------------------------------------
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:
[email protected]