func (u *UniqueScheduler) Schedule(c *citadel.Image, e *citadel.Engine) (bool, error) { containers, err := e.ListContainers(false, false, "") if err != nil { return false, err } if u.hasImage(c, containers) { return false, nil } return true, nil }
func (s *PortScheduler) Schedule(i *citadel.Image, e *citadel.Engine) (bool, error) { containers, err := e.ListContainers(false, false, "") if err != nil { return false, err } if s.hasConflictingPorts(i.BindPorts, containers) { return false, nil } return true, nil }
func setEngineClient(docker *citadel.Engine, tlsConfig *tls.Config) error { var tc *tls.Config u, err := url.Parse(docker.Addr) if err != nil { return err } if u.Scheme == "https" { tc = tlsConfig } return docker.Connect(tc) }
func (i *ImageScheduler) Schedule(c *citadel.Image, e *citadel.Engine) (bool, error) { fullImage := c.Name if !strings.Contains(fullImage, ":") { fullImage = fmt.Sprintf("%s:latest", fullImage) } images, err := e.ListImages() if err != nil { return false, err } if i.containsImage(fullImage, images) { return true, nil } return false, nil }
func setEngineClientAuth(docker *citadel.Engine, username, password, email string) { docker.SetClientAuth(username, password, email) }