Skip to content

Commit efafb7a

Browse files
authored
Merge pull request #912 from kmala/bug
fix(registry): User should be able to pull the image from internal registry
2 parents 48fb991 + cb91c99 commit efafb7a

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

rootfs/api/models/release.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ def image(self):
5454
self.build.image.startswith(settings.REGISTRY_HOST) or
5555
self.build.image.startswith(settings.REGISTRY_URL)
5656
):
57-
# strip registry information off first
58-
image = self.build.image.replace('{}/'.format(settings.REGISTRY_URL), '')
59-
return image.replace('{}/'.format(settings.REGISTRY_HOST), '')
57+
return self.build.image
6058

6159
# Sort out image information based on build type
6260
if self.build.type == 'dockerfile':

rootfs/api/tests/deployments/test_build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ def test_build_image_in_registry(self, mock_requests):
350350

351351
build = Build.objects.get(uuid=response.data['uuid'])
352352
release = build.app.release_set.latest()
353-
# Registry host is internally stripped off
354-
self.assertEqual(release.image, 'autotest/example')
353+
self.assertEqual(release.image, image)
355354

356355
# post an image as a build using registry hostname + port
357356
url = "/v2/apps/test/builds".format(**locals())
@@ -362,8 +361,7 @@ def test_build_image_in_registry(self, mock_requests):
362361

363362
build = Build.objects.get(uuid=response.data['uuid'])
364363
release = build.app.release_set.latest()
365-
# Registry host + port is internally stripped off
366-
self.assertEqual(release.image, 'autotest/example')
364+
self.assertEqual(release.image, image)
367365

368366
def test_build_image_in_registry_with_auth(self, mock_requests):
369367
"""add authentication to the build"""

rootfs/api/tests/test_build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ def test_build_image_in_registry(self, mock_requests):
346346

347347
build = Build.objects.get(uuid=response.data['uuid'])
348348
release = build.app.release_set.latest()
349-
# Registry host is internally stripped off
350-
self.assertEqual(release.image, 'autotest/example')
349+
self.assertEqual(release.image, image)
351350

352351
# post an image as a build using registry hostname + port
353352
url = "/v2/apps/test/builds".format(**locals())
@@ -358,8 +357,7 @@ def test_build_image_in_registry(self, mock_requests):
358357

359358
build = Build.objects.get(uuid=response.data['uuid'])
360359
release = build.app.release_set.latest()
361-
# Registry host + port is internally stripped off
362-
self.assertEqual(release.image, 'autotest/example')
360+
self.assertEqual(release.image, image)
363361

364362
def test_build_image_in_registry_with_auth(self, mock_requests):
365363
"""add authentication to the build"""

0 commit comments

Comments
 (0)