Skip to content

Commit 8e0324e

Browse files
committed
ref(registry): remove insecure_registry calls as a new Registry Proxy takes care of that handling
1 parent fc0c5ba commit 8e0324e

3 files changed

Lines changed: 13 additions & 23 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ The Deis project welcomes contributions from all developers. The high level proc
3535

3636
### Kubernetes
3737

38-
In order to do development on this component, you'll need a working Kubernetes cluster. If you don't have one, follow the [installation instructions][install-k8s] and note that Controller currently targets version 1.2 and higher with the following requirements:
39-
40-
* Docker's `insecure-registry` parameter must include the subnets used by your Kubernetes installation
38+
In order to do development on this component, you'll need a working Kubernetes cluster. If you don't have one, follow the [installation instructions][install-k8s] and note that Controller currently targets version 1.2 and higher.
4139

4240
### Helm Classic
4341

rootfs/registry/dockerclient.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_port(self, target, deis_registry=False, creds=None):
7676
if not deis_registry:
7777
self.login(repo, creds)
7878

79-
info = self.inspect_image(target, deis_registry)
79+
info = self.inspect_image(target)
8080
if 'ExposedPorts' not in info['Config']:
8181
return None
8282

@@ -103,11 +103,11 @@ def publish_release(self, source, target, deis_registry=False, creds=None):
103103

104104
try:
105105
# log into pull repo
106-
if not deis_registry:
106+
if creds is not None:
107107
self.login(repo, creds)
108108

109109
# pull image from source repository
110-
self.pull(repo, src_tag, deis_registry)
110+
self.pull(repo, src_tag)
111111

112112
# tag the image locally without the repository URL
113113
image = "{}:{}".format(src_name, src_tag)
@@ -118,24 +118,18 @@ def publish_release(self, source, target, deis_registry=False, creds=None):
118118
except APIError as e:
119119
raise RegistryException(str(e))
120120

121-
def pull(self, repo, tag, insecure_registry=True):
121+
def pull(self, repo, tag):
122122
"""Pull a Docker image into the local storage graph."""
123123
check_blacklist(repo)
124124
logger.info("Pulling Docker image {}:{}".format(repo, tag))
125125
with SimpleFlock(self.FLOCKFILE, timeout=1200):
126-
stream = self.client.pull(
127-
repo, tag=tag, stream=True, decode=True,
128-
insecure_registry=insecure_registry
129-
)
126+
stream = self.client.pull(repo, tag=tag, stream=True, decode=True)
130127
log_output(stream, 'pull', repo, tag)
131128

132129
def push(self, repo, tag):
133130
"""Push a local Docker image to a registry."""
134131
logger.info("Pushing Docker image {}:{}".format(repo, tag))
135-
stream = self.client.push(
136-
repo, tag=tag, stream=True, decode=True,
137-
insecure_registry=True
138-
)
132+
stream = self.client.push(repo, tag=tag, stream=True, decode=True)
139133
log_output(stream, 'push', repo, tag)
140134

141135
def tag(self, image, repo, tag):
@@ -146,7 +140,7 @@ def tag(self, image, repo, tag):
146140
raise RegistryException('Tagging {} as {}:{} failed'.format(image, repo, tag))
147141

148142
@backoff.on_exception(backoff.expo, Exception, max_tries=3)
149-
def inspect_image(self, target, insecure_registry=True):
143+
def inspect_image(self, target):
150144
"""
151145
Inspect docker image to gather information from it
152146
@@ -156,7 +150,7 @@ def inspect_image(self, target, insecure_registry=True):
156150
repo, tag = docker.utils.parse_repository_tag(target)
157151

158152
# make sure image is pulled locally already
159-
self.pull(repo, tag=tag, insecure_registry=insecure_registry)
153+
self.pull(repo, tag=tag)
160154

161155
# inspect the image
162156
return self.client.inspect_image(target)

rootfs/registry/tests.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def test_publish_release(self, mock_client):
7474
publish_release('ozzy/embryo:git-f2a8020', 'quay.io/ozzy/embryo:v4', True)
7575
docker_push = self.client.client.push
7676
docker_push.assert_called_with(
77-
'localhost:5000/ozzy/embryo', tag='v4', insecure_registry=True,
78-
decode=True, stream=True)
77+
'localhost:5000/ozzy/embryo', tag='v4', decode=True, stream=True
78+
)
7979

8080
# Test that blacklisted image names can't be published
8181
with self.assertRaises(PermissionDenied):
@@ -173,8 +173,7 @@ def test_pull(self, mock_client):
173173
self.client = DockerClient()
174174
self.client.pull('alpine', '3.2')
175175
docker_pull = self.client.client.pull
176-
docker_pull.assert_called_once_with(
177-
'alpine', tag='3.2', insecure_registry=True, decode=True, stream=True)
176+
docker_pull.assert_called_once_with('alpine', tag='3.2', decode=True, stream=True)
178177
# Test that blacklisted image names can't be pulled
179178
with self.assertRaises(PermissionDenied):
180179
self.client.pull('deis/controller', 'v1.11.1')
@@ -185,8 +184,7 @@ def test_push(self, mock_client):
185184
self.client = DockerClient()
186185
self.client.push('ozzy/embryo', 'v4')
187186
docker_push = self.client.client.push
188-
docker_push.assert_called_once_with(
189-
'ozzy/embryo', tag='v4', insecure_registry=True, decode=True, stream=True)
187+
docker_push.assert_called_once_with('ozzy/embryo', tag='v4', decode=True, stream=True)
190188

191189
def test_tag(self, mock_client):
192190
self.client = DockerClient()

0 commit comments

Comments
 (0)