Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Add IS constraint operator #5587

Closed
wants to merge 10 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Less lies
Tim Harper authored and Tim Harper committed Oct 30, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d102815b8b9894c1e1c05975083491f80ef43686
2 changes: 1 addition & 1 deletion src/test/scala/mesosphere/mesos/ConstraintsTest.scala
Original file line number Diff line number Diff line change
@@ -658,7 +658,7 @@ class ConstraintsTest extends UnitTest {
makeOffer("host3") shouldNot meetConstraint(hostnameField, IN, "host1,host2")
}

"trims whitespace after the commas (but not before)" in {
"trims whitespace before and after the commas" in {
makeOffer("host1") should meetConstraint(hostnameField, IN, "host1, host2")
makeOffer("host1") should meetConstraint(hostnameField, IN, "host1 , host2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't here a whitespace before the comma? host1 is not equal to host1[ ]. What am I missing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The separator is a comma optionally surrounded by whitespaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err lol the test description is a lie 😢

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe Mesos constraints what values can be specified on an agent attribute value. A user could potentially put trailing or leading spaces in the value. That would be an awful thing to do, but, none-the-less, possible.

I think it is more likely that people accidentally put a space in comma-delimited list.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in agreement here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vinodkone corrected me; spaces are explicitly not allowed in attribute values, and they are removed by Mesos.

makeOffer("host1") should meetConstraint(hostnameField, IN, "host1 ,host2")