summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/library/oc_scale.py
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lib_openshift/library/oc_scale.py')
-rw-r--r--roles/lib_openshift/library/oc_scale.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/lib_openshift/library/oc_scale.py b/roles/lib_openshift/library/oc_scale.py
index 0c83338b0..9dcb38216 100644
--- a/roles/lib_openshift/library/oc_scale.py
+++ b/roles/lib_openshift/library/oc_scale.py
@@ -868,6 +868,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')