Skip to content
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

Merged
merged 2 commits into from Jul 25, 2016
Merged

Request -- Null Owner fix #1161

merged 2 commits into from Jul 25, 2016

Conversation

MattCCS
Copy link
Contributor

@MattCCS MattCCS commented Jul 20, 2016

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

@ssalinas
Copy link
Member

👍

@Calvinp
Copy link
Contributor

Calvinp commented Jul 20, 2016

The problem was that there were nulls in the list of owners? I had thought the problem was that the owners field itself was null. @wolfd

@ssalinas
Copy link
Member

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");
Copy link
Contributor

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

Copy link
Contributor Author

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.

@ssalinas ssalinas merged commit b2742cc into master Jul 25, 2016
@ssalinas ssalinas deleted the request_null_owner branch July 25, 2016 16:57
@ssalinas ssalinas modified the milestone: 0.9.0 Jul 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants