Skip to content

Commit

Permalink
Merge pull request #234 from litl/jbardin-fixes
Browse files Browse the repository at this point in the history
Remove doutcloud packages
  • Loading branch information
James Bardin committed Apr 24, 2015
2 parents 58426d0 + e3f3bbc commit 603e00f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 42 deletions.
7 changes: 3 additions & 4 deletions GLOCKFILE
Original file line number Diff line number Diff line change
@@ -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
16 changes: 4 additions & 12 deletions galaxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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) {

Expand Down
33 changes: 8 additions & 25 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 603e00f

Please sign in to comment.