Fix docker force pull in k8s glue _kubectl_apply()

This commit is contained in:
allegroai 2021-06-27 09:42:14 +03:00
parent e3c8bd5666
commit 0e7546f248

View File

@ -503,15 +503,15 @@ class K8sIntegration(Worker):
else:
template['spec']['containers'].append(container)
if self._docker_force_pull:
for c in template['spec']['containers']:
c.setdefault('imagePullPolicy', 'Always')
fp, yaml_file = tempfile.mkstemp(prefix='clearml_k8stmpl_', suffix='.yml')
os.close(fp)
with open(yaml_file, 'wt') as f:
yaml.dump(template, f)
if self._docker_force_pull:
for c in template['spec']['containers']:
c.setdefault('imagePullPolicy', 'Always')
kubectl_cmd = self.KUBECTL_APPLY_CMD.format(
task_id=task_id,
docker_image=docker_image,