summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-04-21 12:08:48 -0400
committerKenny Woodson <kwoodson@redhat.com>2017-04-21 12:08:48 -0400
commit9034a202e4efe254d99cb1d11a206e3c848d95c6 (patch)
tree1def1fd1fa43a6f2b3eefdb43c81cd2d9a027afe /roles/lib_openshift/src
parent662aac5d3a46f3eda1f8fc9c9c3196b16671ef18 (diff)
downloadopenshift-9034a202e4efe254d99cb1d11a206e3c848d95c6.tar.gz
openshift-9034a202e4efe254d99cb1d11a206e3c848d95c6.tar.bz2
openshift-9034a202e4efe254d99cb1d11a206e3c848d95c6.tar.xz
openshift-9034a202e4efe254d99cb1d11a206e3c848d95c6.zip
Removing resource version to remove object conflicts caused by race conditions.
Diffstat (limited to 'roles/lib_openshift/src')
-rw-r--r--roles/lib_openshift/src/lib/base.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/lib/base.py b/roles/lib_openshift/src/lib/base.py
index 1868b1420..fc1b6f1ec 100644
--- a/roles/lib_openshift/src/lib/base.py
+++ b/roles/lib_openshift/src/lib/base.py
@@ -76,6 +76,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')