nielsbasjes commented on a change in pull request #11245: 
[FLINK-15794][Kubernetes] Generate the Kubernetes default image version
URL: https://github.com/apache/flink/pull/11245#discussion_r396490294
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
 ##########
 @@ -41,14 +44,19 @@
        public static final String UNKNOWN = "<unknown>";
 
        /**
-        * Returns the version of the code as String. If version == null, then 
the JobManager does not run from a
-        * Maven build. An example is a source code checkout, compile, and run 
from inside an IDE.
-        * 
-        * @return The version string.
+        * Returns the version of the code as String.
+        * @return The project version string.
         */
        public static String getVersion() {
-               String version = 
EnvironmentInformation.class.getPackage().getImplementationVersion();
-               return version != null ? version : UNKNOWN;
+               return PROJECT_VERSION;
 
 Review comment:
   The `class.getPackage().getImplementationVersion();` is a very complex way 
of finding the version of the project at hand. Simply put: Get the same value 
as is available in the project.version property in the pom.xml. 
   I had to generate a Version.java file with the used scala version in it 
because I was unable to get that property via a similar route. So for code 
maintainability I simplified it all and use the same system to get both values.

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


With regards,
Apache Git Services

Reply via email to