gyfora commented on code in PR #270:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/270#discussion_r898778716
##########
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:
can you actually take the string that I wrote? I think you only removed the
end but I improved the whole message.
meta.name -> name
a invalid value -> invalid.
Fix example: 123-abc does not match the regex, it is not valid
##########
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:
can you actually take the string that I wrote please? I think you only
removed the end but I improved the whole message.
meta.name -> name
a invalid value -> invalid.
Fix example: 123-abc does not match the regex, it is not valid
--
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]