gyfora commented on code in PR #270:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/270#discussion_r898736038


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/DefaultValidator.java:
##########
@@ -100,6 +104,21 @@ private static Optional<String> 
firstPresent(Optional<String>... errOpts) {
         return Optional.empty();
     }
 
+    private Optional<String> validateDeploymentName(String name) {
+        if (name == null) {
+            return Optional.of("FlinkDeployment name must be define.");

Review Comment:
   The null check is unnecessary, this will never be null on kubernetes



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/DefaultValidator.java:
##########
@@ -100,6 +104,21 @@ private static Optional<String> 
firstPresent(Optional<String>... errOpts) {
         return Optional.empty();
     }
 
+    private Optional<String> validateDeploymentName(String name) {
+        if (name == null) {
+            return Optional.of("FlinkDeployment name must be define.");
+        } else {
+            Matcher matcher = DEPLOYMENT_NAME_PATTERN.matcher(name);
+            if (!matcher.matches()) {
+                return Optional.of(
+                        String.format(
+                                "The FlinkDeployment meta.name: %s is a 
invalid value, and must start and end with an alphanumeric character (e.g. 
'my-name',  or '123-abc', regex used for validation is 
'[a-z0-9]([-a-z0-9]*[a-z0-9])?'",

Review Comment:
   Minor correction:
   
   ```
   The FlinkDeployment name: %s is invalid. It must consist of lower case 
alphanumeric characters or '-', start with an alphabetic character, and end 
with an alphanumeric character (e.g. 'my-name', or 'abc-123')
   ```



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