Skip to content

Commit

Permalink
Merge pull request #70 from astronomerio/feature/61-resolve-registry-…
Browse files Browse the repository at this point in the history
…and-domain-logic

Make registry authentication explicit
  • Loading branch information
andscoop committed Jun 4, 2018
2 parents f6fcfe3 + 1e497fc commit 811b1ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions auth/auth.go
Expand Up @@ -41,6 +41,8 @@ func Login() {
return
}

fmt.Printf("Successfully authenticated to %s", registry)

// pass successful credentials to config
config.CFG.RegistryAuth.SetProjectString(config.EncodeAuth(username, password))
}
Expand Down
8 changes: 5 additions & 3 deletions cmd/auth.go
Expand Up @@ -11,7 +11,7 @@ import (

var (
registryOverride string
domainOverride string
domainOverride string

authRootCmd = &cobra.Command{
Use: "auth",
Expand Down Expand Up @@ -51,6 +51,10 @@ func authLogin(cmd *cobra.Command, args []string) error {
config.CFG.CloudDomain.SetProjectString(domainOverride)
}

if registryOverride != "" {
config.CFG.RegistryAuthority.SetProjectString(registryOverride)
}

projectRegistry := config.CFG.RegistryAuthority.GetProjectString()
projectCloudDomain := config.CFG.CloudDomain.GetProjectString()
globalCloudDomain := config.CFG.CloudDomain.GetHomeString()
Expand All @@ -59,8 +63,6 @@ func authLogin(cmd *cobra.Command, args []string) error {
// checks for registry in all the expected places
// prompts user for any implicit behavior
switch {
case registryOverride != "":
config.CFG.RegistryAuthority.SetProjectString(registryOverride)
case projectRegistry != "":
// Don't prompt user, using project config is default expected behavior
break
Expand Down

0 comments on commit 811b1ee

Please sign in to comment.