File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,6 +162,8 @@ func build(
162162 slugName ,
163163 conf .StorageType ,
164164 conf .DockerBuilderImage ,
165+ conf .RegistryHost ,
166+ conf .RegistryPort ,
165167 registryEnv ,
166168 dockerBuilderImagePullPolicy ,
167169 )
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ type Config struct {
1616 // k8s service discovery env vars
1717 ControllerHost string `envconfig:"DEIS_CONTROLLER_SERVICE_HOST" required:"true"`
1818 ControllerPort string `envconfig:"DEIS_CONTROLLER_SERVICE_PORT" required:"true"`
19+ RegistryHost string `envconfig:"DEIS_REGISTRY_SERVICE_HOST" required:"true"`
20+ RegistryPort string `envconfig:"DEIS_REGISTRY_SERVICE_PORT" required:"true"`
1921 RegistryProxyPort string `envconfig:"DEIS_REGISTRY_PROXY_PORT" default:"5555"`
2022 RegistryLocation string `envconfig:"DEIS_REGISTRY_LOCATION" default:"on-cluster"`
2123 RegistrySecretPrefix string `envconfig:"DEIS_REGISTRY_SECRET_PREFIX" default:"private-registry"`
Original file line number Diff line number Diff line change @@ -43,7 +43,9 @@ func dockerBuilderPod(
4343 tarKey ,
4444 imageName ,
4545 storageType ,
46- image string ,
46+ image ,
47+ registryHost ,
48+ registryPort string ,
4749 registryEnv map [string ]string ,
4850 pullPolicy api.PullPolicy ,
4951) * api.Pod {
@@ -56,6 +58,10 @@ func dockerBuilderPod(
5658 addEnvToPod (pod , tarPath , tarKey )
5759 addEnvToPod (pod , "IMG_NAME" , imageName )
5860 addEnvToPod (pod , builderStorage , storageType )
61+ // inject existing DEIS_REGISTRY_SERVICE_HOST and PORT info to dockerbuilder
62+ // see https://github.com/deis/dockerbuilder/issues/83
63+ addEnvToPod (pod , "DEIS_REGISTRY_SERVICE_HOST" , registryHost )
64+ addEnvToPod (pod , "DEIS_REGISTRY_SERVICE_PORT" , registryPort )
5965
6066 for key , value := range registryEnv {
6167 addEnvToPod (pod , key , value )
Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ func TestBuildPod(t *testing.T) {
132132 build .imgName ,
133133 build .storageType ,
134134 build .dockerBuilderImage ,
135+ "localhost" ,
136+ "5555" ,
135137 regEnv ,
136138 build .dockerBuilderImagePullPolicy ,
137139 )
You can’t perform that action at this time.
0 commit comments