Skip to content

Commit 5f6511c

Browse files
committed
Add gcrurl env var to addon deployment and configuration
1 parent b0054c4 commit 5f6511c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Diff for: cmd/minikube/cmd/config/configure.go

+7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var addonsConfigureCmd = &cobra.Command{
5252
dockerServer := "changeme"
5353
dockerUser := "changeme"
5454
dockerPass := "changeme"
55+
gcrURL := "https://gcr.io"
5556

5657
enableAWSECR := AskForYesNoConfirmation("\nDo you want to enable AWS Elastic Container Registry?", posResponses, negResponses)
5758
if enableAWSECR {
@@ -64,6 +65,11 @@ var addonsConfigureCmd = &cobra.Command{
6465
enableGCR := AskForYesNoConfirmation("\nDo you want to enable Google Container Registry?", posResponses, negResponses)
6566
if enableGCR {
6667
gcrPath := AskForStaticValue("-- Enter path to credentials (e.g. /home/user/.config/gcloud/application_default_credentials.json):")
68+
gcrchangeURL := AskForYesNoConfirmation("-- Do you want to change the GCR URL (Default https://gcr.io)?", posResponses, negResponses)
69+
70+
if gcrchangeURL {
71+
gcrURL = AskForStaticValue("-- Enter GCR URL (e.g. https://asia.gcr.io):")
72+
}
6773

6874
// Read file from disk
6975
dat, err := ioutil.ReadFile(gcrPath)
@@ -108,6 +114,7 @@ var addonsConfigureCmd = &cobra.Command{
108114
"registry-creds-gcr",
109115
map[string]string{
110116
"application_default_credentials.json": gcrApplicationDefaultCredentials,
117+
"gcrurl": gcrURL,
111118
},
112119
map[string]string{
113120
"app": "registry-creds",

Diff for: deploy/addons/registry-creds/registry-creds-rc.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ spec:
6060
secretKeyRef:
6161
name: registry-creds-dpr
6262
key: DOCKER_PRIVATE_REGISTRY_USER
63+
- name: gcrurl
64+
valueFrom:
65+
secretKeyRef:
66+
name: registry-creds-gcr
67+
key: gcrurl
6368
volumeMounts:
6469
- name: gcr-creds
6570
mountPath: "/root/.config/gcloud"
@@ -68,3 +73,7 @@ spec:
6873
- name: gcr-creds
6974
secret:
7075
secretName: registry-creds-gcr
76+
items:
77+
- key: "application_default_credentials.json"
78+
path: "application_default_credentials.json"
79+

0 commit comments

Comments
 (0)