diff --git a/GLOCKFILE b/GLOCKFILE index 9182485..0db3540 100644 --- a/GLOCKFILE +++ b/GLOCKFILE @@ -1,11 +1,10 @@ github.com/BurntSushi/toml f87ce853111478914f0bcffa34d43a93643e6eda -github.com/Sirupsen/logrus 55eb11d21d2a31a3cc93838241d04800f52e823d +github.com/Sirupsen/logrus 26709e2714106fb8ad40b773b711ebce25b78914 github.com/codegangsta/cli 50c77ecec0068c9aef9d90ae0fd0fdf410041da3 -github.com/docker/docker 9922122fd467b3ba384801a059b05b00fd65998e -github.com/dotcloud/docker 24c4c3e0e99ddb4d65200f2f7367883e47008898 +github.com/docker/docker 300a12f9aa44636bcad80549702f3dc57e3381e6 github.com/fatih/color 95b468b5f34882796c597b718955603a584a9bd4 github.com/fsouza/go-dockerclient 4a43f0ee9fe0c8f6cb7672b41b11122b40bb531a -github.com/garyburd/redigo 61e2910408efd40dafb3c7d856a4cf8aeb5fb1c6 +github.com/garyburd/redigo 535138d7bcd717d6531c701ef5933d98b1866257 github.com/goamz/goamz a1da1b724496ac803aabd4898e15e74535d68ee0 github.com/litl/shuttle f2398ad6626694603accb6d34183aedee79336df github.com/ryanuber/columnize fef4ee9c9ecfb000e86ca19ac9cea7d58200d5b6 diff --git a/galaxy.go b/galaxy.go index 844075d..b815c83 100644 --- a/galaxy.go +++ b/galaxy.go @@ -10,17 +10,16 @@ import ( "sync" "time" - "github.com/BurntSushi/toml" - "github.com/codegangsta/cli" + "github.com/litl/galaxy/commander" gconfig "github.com/litl/galaxy/config" "github.com/litl/galaxy/log" "github.com/litl/galaxy/registry" "github.com/litl/galaxy/runtime" "github.com/litl/galaxy/utils" - "github.com/ryanuber/columnize" - "github.com/dotcloud/docker/pkg/term" - "github.com/litl/galaxy/commander" + "github.com/BurntSushi/toml" + "github.com/codegangsta/cli" + "github.com/ryanuber/columnize" ) var ( @@ -30,19 +29,12 @@ var ( initOnce sync.Once buildVersion string - - // make certain we have a tty for interactive prompts - tty bool ) var config struct { Host string `toml:"host"` } -func init() { - tty = term.IsTerminal(os.Stdin.Fd()) -} - // ensure the registry as a redis host, but only once func initRegistry(c *cli.Context) { diff --git a/runtime/runtime.go b/runtime/runtime.go index 78ec8b3..1eeb653 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -11,7 +11,6 @@ import ( "strings" "time" - auth "github.com/dotcloud/docker/registry" docker "github.com/fsouza/go-dockerclient" "github.com/litl/galaxy/config" "github.com/litl/galaxy/log" @@ -23,7 +22,6 @@ var blacklistedContainerId = make(map[string]bool) type ServiceRuntime struct { dockerClient *docker.Client - authConfig *auth.ConfigFile dns string serviceRegistry *registry.ServiceRegistry dockerIP string @@ -753,31 +751,16 @@ func (s *ServiceRuntime) PullImage(version, id string) (*docker.Image, error) { Tag: tag, OutputStream: log.DefaultLogger} - dockerAuth := docker.AuthConfiguration{} - if registry != "" && s.authConfig == nil { - - pullOpts.Repository = registry + "/" + repository - pullOpts.Registry = registry - pullOpts.Tag = tag - - homeDir := utils.HomeDir() - if homeDir == "" { - return nil, errors.New("ERROR: Unable to determine current home dir. Set $HOME") - } - - // use ~/.dockercfg - authConfig, err := auth.LoadConfig(homeDir) - if err != nil { - panic(err) - } + auths, err := docker.NewAuthConfigurationsFromDockerCfg() + if err != nil { + panic(err) + } - pullOpts.Registry = registry - authCreds := authConfig.ResolveAuthConfig(registry) + dockerAuth := auths.Configs[registry] - dockerAuth.Username = authCreds.Username - dockerAuth.Password = authCreds.Password - dockerAuth.Email = authCreds.Email - } + pullOpts.Repository = registry + "/" + repository + pullOpts.Registry = registry + pullOpts.Tag = tag retries := 0 for { diff --git a/stacks.go b/stacks.go index 3798ae8..31003f4 100644 --- a/stacks.go +++ b/stacks.go @@ -77,7 +77,8 @@ func getBase(c *cli.Context) string { } func promptValue(prompt, dflt string) string { - if !tty { + term := os.Getenv("TERM") + if term == "" || term == "dumb" { return dflt }