Skip to content

Commit b583180

Browse files
authored
Merge pull request #386 from kmala/bug
feat(registry): use registry proxy to talk to the internal registry
2 parents 8cc816f + e433e1f commit b583180

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

pkg/gitreceive/build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func build(
149149
slugName,
150150
conf.StorageType,
151151
conf.DockerBuilderImage,
152+
conf.RegistryProxyPort,
152153
dockerBuilderImagePullPolicy,
153154
)
154155
} else {

pkg/gitreceive/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const (
1414
// builder's git-receive hook.
1515
type Config struct {
1616
// k8s service discovery env vars
17-
ControllerHost string `envconfig:"DEIS_CONTROLLER_SERVICE_HOST" required:"true"`
18-
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"`
17+
ControllerHost string `envconfig:"DEIS_CONTROLLER_SERVICE_HOST" required:"true"`
18+
ControllerPort string `envconfig:"DEIS_CONTROLLER_SERVICE_PORT" required:"true"`
19+
RegistryHost string `envconfig:"DEIS_REGISTRY_SERVICE_HOST" required:"true"`
20+
RegistryProxyPort string `envconfig:"DEIS_REGISTRY_PROXY_PORT" default:"5555"`
2121

2222
GitHome string `envconfig:"GIT_HOME" required:"true"`
2323
SSHConnection string `envconfig:"SSH_CONNECTION" required:"true"`

pkg/gitreceive/k8s_util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func dockerBuilderPod(
4343
tarKey,
4444
imageName,
4545
storageType,
46-
image string,
46+
image, registryProxyPort string,
4747
pullPolicy api.PullPolicy,
4848
) *api.Pod {
4949

@@ -55,6 +55,7 @@ func dockerBuilderPod(
5555
addEnvToPod(pod, tarPath, tarKey)
5656
addEnvToPod(pod, "IMG_NAME", imageName)
5757
addEnvToPod(pod, builderStorage, storageType)
58+
addEnvToPod(pod, "DEIS_REGISTRY_PROXY_PORT", registryProxyPort)
5859

5960
pod.Spec.Containers[0].VolumeMounts = append(pod.Spec.Containers[0].VolumeMounts, api.VolumeMount{
6061
Name: dockerSocketName,

pkg/gitreceive/k8s_util_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func TestBuildPod(t *testing.T) {
132132
build.imgName,
133133
build.storageType,
134134
build.dockerBuilderImage,
135+
"5555",
135136
build.dockerBuilderImagePullPolicy,
136137
)
137138

0 commit comments

Comments
 (0)