From 9034a202e4efe254d99cb1d11a206e3c848d95c6 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 21 Apr 2017 12:08:48 -0400 Subject: Removing resource version to remove object conflicts caused by race conditions. --- roles/lib_openshift/library/oc_obj.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'roles/lib_openshift/library/oc_obj.py') diff --git a/roles/lib_openshift/library/oc_obj.py b/roles/lib_openshift/library/oc_obj.py index 0b01670c6..706972de2 100644 --- a/roles/lib_openshift/library/oc_obj.py +++ b/roles/lib_openshift/library/oc_obj.py @@ -893,6 +893,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') -- cgit v1.2.3