Ver Fonte

Removing resource version to remove object conflicts caused by race conditions.

Kenny Woodson há 8 anos atrás
pai
commit
9034a202e4
28 ficheiros alterados com 196 adições e 0 exclusões
  1. 7 0
      roles/lib_openshift/library/oc_adm_ca_server_cert.py
  2. 7 0
      roles/lib_openshift/library/oc_adm_manage_node.py
  3. 7 0
      roles/lib_openshift/library/oc_adm_policy_group.py
  4. 7 0
      roles/lib_openshift/library/oc_adm_policy_user.py
  5. 7 0
      roles/lib_openshift/library/oc_adm_registry.py
  6. 7 0
      roles/lib_openshift/library/oc_adm_router.py
  7. 7 0
      roles/lib_openshift/library/oc_clusterrole.py
  8. 7 0
      roles/lib_openshift/library/oc_configmap.py
  9. 7 0
      roles/lib_openshift/library/oc_edit.py
  10. 7 0
      roles/lib_openshift/library/oc_env.py
  11. 7 0
      roles/lib_openshift/library/oc_group.py
  12. 7 0
      roles/lib_openshift/library/oc_image.py
  13. 7 0
      roles/lib_openshift/library/oc_label.py
  14. 7 0
      roles/lib_openshift/library/oc_obj.py
  15. 7 0
      roles/lib_openshift/library/oc_objectvalidator.py
  16. 7 0
      roles/lib_openshift/library/oc_process.py
  17. 7 0
      roles/lib_openshift/library/oc_project.py
  18. 7 0
      roles/lib_openshift/library/oc_pvc.py
  19. 7 0
      roles/lib_openshift/library/oc_route.py
  20. 7 0
      roles/lib_openshift/library/oc_scale.py
  21. 7 0
      roles/lib_openshift/library/oc_secret.py
  22. 7 0
      roles/lib_openshift/library/oc_service.py
  23. 7 0
      roles/lib_openshift/library/oc_serviceaccount.py
  24. 7 0
      roles/lib_openshift/library/oc_serviceaccount_secret.py
  25. 7 0
      roles/lib_openshift/library/oc_user.py
  26. 7 0
      roles/lib_openshift/library/oc_version.py
  27. 7 0
      roles/lib_openshift/library/oc_volume.py
  28. 7 0
      roles/lib_openshift/src/lib/base.py

+ 7 - 0
roles/lib_openshift/library/oc_adm_ca_server_cert.py

@@ -900,6 +900,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')

+ 7 - 0
roles/lib_openshift/library/oc_adm_manage_node.py

@@ -886,6 +886,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')

+ 7 - 0
roles/lib_openshift/library/oc_adm_policy_group.py

@@ -872,6 +872,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')

+ 7 - 0
roles/lib_openshift/library/oc_adm_policy_user.py

@@ -872,6 +872,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')

+ 7 - 0
roles/lib_openshift/library/oc_adm_registry.py

@@ -990,6 +990,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')

+ 7 - 0
roles/lib_openshift/library/oc_adm_router.py

@@ -1015,6 +1015,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')

+ 7 - 0
roles/lib_openshift/library/oc_clusterrole.py

@@ -864,6 +864,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')

+ 7 - 0
roles/lib_openshift/library/oc_configmap.py

@@ -870,6 +870,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')

+ 7 - 0
roles/lib_openshift/library/oc_edit.py

@@ -914,6 +914,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')

+ 7 - 0
roles/lib_openshift/library/oc_env.py

@@ -881,6 +881,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')

+ 7 - 0
roles/lib_openshift/library/oc_group.py

@@ -854,6 +854,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')

+ 7 - 0
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')

+ 7 - 0
roles/lib_openshift/library/oc_label.py

@@ -890,6 +890,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')

+ 7 - 0
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')

+ 7 - 0
roles/lib_openshift/library/oc_objectvalidator.py

@@ -825,6 +825,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')

+ 7 - 0
roles/lib_openshift/library/oc_process.py

@@ -882,6 +882,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')

+ 7 - 0
roles/lib_openshift/library/oc_project.py

@@ -879,6 +879,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')

+ 7 - 0
roles/lib_openshift/library/oc_pvc.py

@@ -874,6 +874,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')

+ 7 - 0
roles/lib_openshift/library/oc_route.py

@@ -924,6 +924,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')

+ 7 - 0
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')

+ 7 - 0
roles/lib_openshift/library/oc_secret.py

@@ -914,6 +914,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')

+ 7 - 0
roles/lib_openshift/library/oc_service.py

@@ -920,6 +920,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')

+ 7 - 0
roles/lib_openshift/library/oc_serviceaccount.py

@@ -866,6 +866,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')

+ 7 - 0
roles/lib_openshift/library/oc_serviceaccount_secret.py

@@ -866,6 +866,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')

+ 7 - 0
roles/lib_openshift/library/oc_user.py

@@ -926,6 +926,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')

+ 7 - 0
roles/lib_openshift/library/oc_version.py

@@ -838,6 +838,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')

+ 7 - 0
roles/lib_openshift/library/oc_volume.py

@@ -903,6 +903,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')

+ 7 - 0
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')