Fix docker image check issue (#6)
This commit is contained in:
Родитель
5f3a5e0cca
Коммит
e5942ac4b6
|
@ -0,0 +1,3 @@
|
|||
.vscode
|
||||
__pycache__
|
||||
*.pyc
|
|
@ -171,7 +171,8 @@ class ImageChecker(): #pylint: disable=too-few-public-methods
|
|||
|
||||
def _get_normalized_image_info(self) -> dict:
|
||||
uri = self._image_uri
|
||||
if not self._is_image_use_default_domain():
|
||||
use_default_domain = self._is_image_use_default_domain()
|
||||
if not use_default_domain:
|
||||
assert "/" in self._image_uri
|
||||
index = self._image_uri.find("/")
|
||||
uri = self._image_uri[index + 1:]
|
||||
|
@ -186,7 +187,7 @@ class ImageChecker(): #pylint: disable=too-few-public-methods
|
|||
self._image_uri))
|
||||
|
||||
repo_chunks = uri_chunks[0].split("/")
|
||||
if len(repo_chunks) == 1:
|
||||
if len(repo_chunks) == 1 and use_default_domain:
|
||||
return {"repo": "library/{}".format(repository), "tag": tag}
|
||||
return {"repo": repository, "tag": tag}
|
||||
|
||||
|
|
|
@ -192,7 +192,13 @@ class TestImageChecker(unittest.TestCase):
|
|||
"expect_image_info": {
|
||||
"repo": "pytorch/pytorch",
|
||||
"tag": "1.3-cuda10.1-cudnn7-runtime"
|
||||
}
|
||||
},
|
||||
}, {
|
||||
"image_uri": "test.azurecr.io/test-base:4dc825cebeam2",
|
||||
"expect_image_info": {
|
||||
"repo": "test-base",
|
||||
"tag": "4dc825cebeam2"
|
||||
},
|
||||
}]
|
||||
|
||||
for test_case in test_cases:
|
||||
|
|
Загрузка…
Ссылка в новой задаче