This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add constraint support for Zone and Region (#5574)
* Add constraint support for Zone and Region * Zone / Region info added to agentInfo * Consolidate matcher code JIRA Issues: MARATHON_EE-1665 * ov => offerValue * use @ instead of * for field prefix and other things * introduce meetConstraint matcher * more consistent variable naming * selectInstancesToKill recognizes native region and zone fields * convert one more test case to use matcher
- Loading branch information
1 parent
50449fb
commit 3fc89ec
Showing
24 changed files
with
370 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package mesosphere.marathon | ||
package tasks | ||
|
||
import org.apache.mesos.Protos.Offer | ||
|
||
object OfferUtil { | ||
def region(offer: Offer): Option[String] = if (offer.hasDomain) { | ||
val domain = offer.getDomain | ||
if (domain.hasFaultDomain) { | ||
// region and name are marked as required in the protobuf definition | ||
Some(domain.getFaultDomain.getRegion.getName) | ||
} else None | ||
} else None | ||
|
||
def zone(offer: Offer): Option[String] = | ||
if (offer.hasDomain) { | ||
val domain = offer.getDomain | ||
if (domain.hasFaultDomain) { | ||
// zone and name are marked as required in the protobuf definition | ||
Some(domain.getFaultDomain.getZone.getName) | ||
} else None | ||
} else None | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.