Skip to content

Commit

Permalink
Updated based on code review
Browse files Browse the repository at this point in the history
  • Loading branch information
cppwfs committed Dec 13, 2019
1 parent 6d1a617 commit 9455681
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void schedule(ScheduleRequest scheduleRequest) {
}

invalidCronExceptionMessage = getExceptionMessageForField(e, SCHEDULE_METADATA_FIELD_NAME);
if (isScheduleNameTooLong(invalidCronExceptionMessage)) {
if (validationScheduleNameLength(invalidCronExceptionMessage)) {
throw new CreateScheduleException(invalidCronExceptionMessage, e);
}

Expand Down Expand Up @@ -211,11 +211,7 @@ private void setImagePullSecret(ScheduleRequest scheduleRequest, CronJob cronJob
}
}

private boolean isScheduleNameTooLong(String message ) {
boolean result = false;
if(StringUtils.hasText(message) && message.contains("must be no more than") && message.endsWith("characters")) {
result = true;
}
return result;
private boolean validationScheduleNameLength(String message ) {
return (StringUtils.hasText(message) && message.contains("must be no more than") && message.endsWith("characters"));
}
}

0 comments on commit 9455681

Please sign in to comment.