util

package
v0.0.0-...-a69e935 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 9 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResourcesFromOffers

func GetResourcesFromOffers(offers map[string]*mesos.Offer) scalar.Resources

GetResourcesFromOffers returns the combined number of scalar.resources passed as a map of offerid->mesos.offer map.

func HasExclusiveAttribute

func HasExclusiveAttribute(attributes []*mesos.Attribute) bool

HasExclusiveAttribute returns true if the provided attributes contains the "peloton/exclusive" attribute.

func IsSlackResourceType

func IsSlackResourceType(resourceType string, slackResourceTypes []string) bool

IsSlackResourceType validates is given resource type is supported slack resource.

func LabelKeyToEnvVarName

func LabelKeyToEnvVarName(labelKey string) string

LabelKeyToEnvVarName converts a task label key to an env var name Example: label key 'peloton.job_id' converted to env var name 'PELOTON_JOB_ID'

func MatchSchedulingConstraint

func MatchSchedulingConstraint(
	hostname string,
	additionalLV constraints.LabelValues,
	attributes []*mesos.Attribute,
	constraint *task.Constraint,
	evaluator constraints.Evaluator,
) hostsvc.HostFilterResult

func MesosOffersToHostOffer

func MesosOffersToHostOffer(hostOfferID string, mesosOffers []*mesos.Offer) *hostsvc.HostOffer

MesosOffersToHostOffer takes the Mesos Offers of a host and returns the Host Offer

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL