예제 #1
0
파일: swarm.go 프로젝트: yuenmeiwan/quilt
func makeLabels(dbc db.Container, connections []db.Connection) map[string]string {
	labels := map[string]string{
		docker.SchedulerLabelKey: docker.SchedulerLabelValue,
	}

	for _, lb := range dbc.Labels {
		// Add Stitch labels
		labels[docker.UserLabel(lb)] = docker.LabelTrueValue
	}

	return labels
}
예제 #2
0
// AffinityStr is passed to Docker Swarm to implement the LabelRule.
func (lr LabelRule) AffinityStr() string {
	return toAffinity(docker.UserLabel(lr.OtherLabel), !lr.Exclusive,
		docker.LabelTrueValue)
}