mirror of
https://github.com/clearml/clearml-agent
synced 2025-06-26 18:16:15 +00:00
Fix docker force pull in k8s glue _kubectl_apply()
This commit is contained in:
parent
e3c8bd5666
commit
0e7546f248
@ -503,15 +503,15 @@ class K8sIntegration(Worker):
|
|||||||
else:
|
else:
|
||||||
template['spec']['containers'].append(container)
|
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')
|
fp, yaml_file = tempfile.mkstemp(prefix='clearml_k8stmpl_', suffix='.yml')
|
||||||
os.close(fp)
|
os.close(fp)
|
||||||
with open(yaml_file, 'wt') as f:
|
with open(yaml_file, 'wt') as f:
|
||||||
yaml.dump(template, 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(
|
kubectl_cmd = self.KUBECTL_APPLY_CMD.format(
|
||||||
task_id=task_id,
|
task_id=task_id,
|
||||||
docker_image=docker_image,
|
docker_image=docker_image,
|
||||||
|
Loading…
Reference in New Issue
Block a user