Skip to content

Commit

Permalink
Merge pull request #1436 from Teddy-Schmitz/registry-creds-gcrurl
Browse files Browse the repository at this point in the history
Add gcrurl env var to registry-creds addon deployment and configuration
  • Loading branch information
aaron-prindle authored Jul 24, 2017
2 parents 2e9ebb6 + 5f6511c commit 29a7d71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/minikube/cmd/config/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var addonsConfigureCmd = &cobra.Command{
dockerServer := "changeme"
dockerUser := "changeme"
dockerPass := "changeme"
gcrURL := "https://gcr.io"

enableAWSECR := AskForYesNoConfirmation("\nDo you want to enable AWS Elastic Container Registry?", posResponses, negResponses)
if enableAWSECR {
Expand All @@ -66,6 +67,11 @@ var addonsConfigureCmd = &cobra.Command{
enableGCR := AskForYesNoConfirmation("\nDo you want to enable Google Container Registry?", posResponses, negResponses)
if enableGCR {
gcrPath := AskForStaticValue("-- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):")
gcrchangeURL := AskForYesNoConfirmation("-- Do you want to change the GCR URL (Default https://gcr.io)?", posResponses, negResponses)

if gcrchangeURL {
gcrURL = AskForStaticValue("-- Enter GCR URL (e.g. https://asia.gcr.io):")
}

// Read file from disk
dat, err := ioutil.ReadFile(gcrPath)
Expand Down Expand Up @@ -111,6 +117,7 @@ var addonsConfigureCmd = &cobra.Command{
"registry-creds-gcr",
map[string]string{
"application_default_credentials.json": gcrApplicationDefaultCredentials,
"gcrurl": gcrURL,
},
map[string]string{
"app": "registry-creds",
Expand Down
9 changes: 9 additions & 0 deletions deploy/addons/registry-creds/registry-creds-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ spec:
secretKeyRef:
name: registry-creds-dpr
key: DOCKER_PRIVATE_REGISTRY_USER
- name: gcrurl
valueFrom:
secretKeyRef:
name: registry-creds-gcr
key: gcrurl
volumeMounts:
- name: gcr-creds
mountPath: "/root/.config/gcloud"
Expand All @@ -73,3 +78,7 @@ spec:
- name: gcr-creds
secret:
secretName: registry-creds-gcr
items:
- key: "application_default_credentials.json"
path: "application_default_credentials.json"

0 comments on commit 29a7d71

Please sign in to comment.