-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request -- Null Owner fix #1161
Conversation
👍 |
The problem was that there were |
The owners field itself is an optional. I can double check this to be sure, but as far as I know that should come through as an Optional.absent (meaning we are already handling it) if the owners field as a whole is null. If that is not the case though please update us here @Calvinp |
@@ -114,6 +114,10 @@ public SingularityRequest checkSingularityRequest(SingularityRequest request, Op | |||
checkBadRequest(request.getId() != null && !StringUtils.containsAny(request.getId(), JOINER.join(REQUEST_ID_ILLEGAL_CHARACTERS)), "Id can not be null or contain any of the following characters: %s", REQUEST_ID_ILLEGAL_CHARACTERS); | |||
checkBadRequest(request.getRequestType() != null, "RequestType cannot be null or missing"); | |||
|
|||
if (request.getOwners().isPresent()) { | |||
checkBadRequest(!request.getOwners().get().contains(null), "Request owner(s) must not be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wording here is a little vague (i.e. owners: null
is actually valid, but the message makes it sound like it wouldn't be) -- perhaps something like "Request owners cannot contain null values" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll change that.
This PR prevents new requests from being created which have one or more null owners, which have been causing errors elsewhere in Singularity.
(Dupe of #1160 for master at ssalinas' request)
/cc @ssalinas @Calvinp @tpetr