summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/library/oc_image.py
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lib_openshift/library/oc_image.py')
-rw-r--r--roles/lib_openshift/library/oc_image.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/lib_openshift/library/oc_image.py b/roles/lib_openshift/library/oc_image.py
index 8aed060bb..bb7f97689 100644
--- a/roles/lib_openshift/library/oc_image.py
+++ b/roles/lib_openshift/library/oc_image.py
@@ -873,6 +873,13 @@ class OpenShiftCLI(object):
def _replace(self, fname, force=False):
'''replace the current object with oc replace'''
+ # We are removing the 'resourceVersion' to handle
+ # a race condition when modifying oc objects
+ yed = Yedit(fname)
+ results = yed.delete('metadata.resourceVersion')
+ if results[0]:
+ yed.write()
+
cmd = ['replace', '-f', fname]
if force:
cmd.append('--force')