Hack to fix #7738: Allow tag in image parameter of docker module
It also defaults to the "latest" tag for pulling the image instead of pulling all versions.
This commit is contained in:
parent
5591e8838d
commit
0f67a94820
1 changed files with 9 additions and 1 deletions
10
cloud/docker
10
cloud/docker
|
@ -477,6 +477,13 @@ class DockerManager:
|
||||||
else:
|
else:
|
||||||
return image, tag
|
return image, tag
|
||||||
|
|
||||||
|
def get_split_full_image_tag(self, image):
|
||||||
|
tag = "latest"
|
||||||
|
if image.find(':') > 0:
|
||||||
|
return image.split(':')
|
||||||
|
else:
|
||||||
|
return image, tag
|
||||||
|
|
||||||
def get_summary_counters_msg(self):
|
def get_summary_counters_msg(self):
|
||||||
msg = ""
|
msg = ""
|
||||||
for k, v in self.counters.iteritems():
|
for k, v in self.counters.iteritems():
|
||||||
|
@ -576,7 +583,8 @@ class DockerManager:
|
||||||
try:
|
try:
|
||||||
containers = do_create(count, params)
|
containers = do_create(count, params)
|
||||||
except:
|
except:
|
||||||
self.client.pull(params['image'])
|
image, tag = self.get_split_full_image_tag(params['image'])
|
||||||
|
self.client.pull(image, tag = tag)
|
||||||
self.increment_counter('pull')
|
self.increment_counter('pull')
|
||||||
containers = do_create(count, params)
|
containers = do_create(count, params)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue