Skip to content

Commit 29a7d71

Browse files
Merge pull request #1436 from Teddy-Schmitz/registry-creds-gcrurl
Add gcrurl env var to registry-creds addon deployment and configuration
2 parents 2e9ebb6 + 5f6511c commit 29a7d71

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cmd/minikube/cmd/config/configure.go

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

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

7076
// Read file from disk
7177
dat, err := ioutil.ReadFile(gcrPath)
@@ -111,6 +117,7 @@ var addonsConfigureCmd = &cobra.Command{
111117
"registry-creds-gcr",
112118
map[string]string{
113119
"application_default_credentials.json": gcrApplicationDefaultCredentials,
120+
"gcrurl": gcrURL,
114121
},
115122
map[string]string{
116123
"app": "registry-creds",

deploy/addons/registry-creds/registry-creds-rc.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ spec:
6565
secretKeyRef:
6666
name: registry-creds-dpr
6767
key: DOCKER_PRIVATE_REGISTRY_USER
68+
- name: gcrurl
69+
valueFrom:
70+
secretKeyRef:
71+
name: registry-creds-gcr
72+
key: gcrurl
6873
volumeMounts:
6974
- name: gcr-creds
7075
mountPath: "/root/.config/gcloud"
@@ -73,3 +78,7 @@ spec:
7378
- name: gcr-creds
7479
secret:
7580
secretName: registry-creds-gcr
81+
items:
82+
- key: "application_default_credentials.json"
83+
path: "application_default_credentials.json"
84+

0 commit comments

Comments
 (0)