Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gcrurl env var to registry-creds addon deployment and configuration #1436

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/minikube/cmd/config/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,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 @@ -64,6 +65,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 @@ -108,6 +114,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 @@ -60,6 +60,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 @@ -68,3 +73,7 @@ spec:
- name: gcr-creds
secret:
secretName: registry-creds-gcr
items:
- key: "application_default_credentials.json"
path: "application_default_credentials.json"