예제 #1
0
func appendNs(p *project.Project, rels []project.ServiceRelationship, conf string, relType project.ServiceRelationshipType) []project.ServiceRelationship {
	service := GetContainerFromIpcLikeConfig(p, conf)
	if service != "" {
		rels = append(rels, project.NewServiceRelationship(service, relType))
	}
	return rels
}
예제 #2
0
파일: service.go 프로젝트: pirater/os
func appendLink(deps []project.ServiceRelationship, name string, optional bool, p *project.Project) []project.ServiceRelationship {
	if _, ok := p.Configs[name]; !ok {
		return deps
	}
	rel := project.NewServiceRelationship(name, project.RelTypeLink)
	rel.Optional = optional
	return append(deps, rel)
}
예제 #3
0
func (r *RancherService) DependentServices() []project.ServiceRelationship {
	result := []project.ServiceRelationship{}

	for _, rel := range service.DefaultDependentServices(r.context.Project, r) {
		if rel.Type == project.RelTypeLink {
			rel.Optional = true
			result = append(result, rel)
		}
	}

	// Load balancers should depend on non-external target services
	lbConfig := r.RancherConfig().LbConfig
	if lbConfig != nil {
		for _, portRule := range lbConfig.PortRules {
			if !strings.Contains(portRule.Service, "/") {
				result = append(result, project.NewServiceRelationship(portRule.Service, project.RelTypeLink))
			}
		}
	}

	return result
}
예제 #4
0
func appendLink(deps []project.ServiceRelationship, name string, optional bool) []project.ServiceRelationship {
	rel := project.NewServiceRelationship(name, project.REL_TYPE_LINK)
	rel.Optional = optional
	return append(deps, rel)
}