Commit b491b7ff authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Image.update’s pull option

parent e8920bae
......@@ -598,9 +598,11 @@ class Image(models.Model):
def push(self):
return ['docker', 'push', self.get_image_name()]
def update(self):
def update(self, pull=False):
image = check_output(['docker', 'images', '-q', self.get_image_name()]).decode().strip()
if not image:
if not pull:
return
try:
logger.info(f' pulling {self}')
check_output(self.pull())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment