Grypse commented on code in PR #270:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/270#discussion_r898924206
##########
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:
I change the message to this:
`The FlinkDeployment name: %s is invalid, 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'), and the length
must be no more than 45 characters.`
More detailed message have been added, including what to start and end with
and length requirements.
What do u think?
--
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]