Skip to content

Commit 4ea46e7

Browse files
author
Keerthan Reddy Mala
committed
feat(registry): use registry proxy to talk to the internal registry
1 parent 8cc816f commit 4ea46e7

3 files changed

Lines changed: 7 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,

0 commit comments

Comments
 (0)