@@ -87,7 +87,6 @@ def main():
8787 )
8888 print ("Resource created" )
8989
90-
9190 # get the resource and print out data
9291 resource = api .get_namespaced_custom_object (
9392 group = "stable.example.com" ,
@@ -99,30 +98,28 @@ def main():
9998 print ("Resource details:" )
10099 pprint (resource )
101100
102-
103- # delete it
104- api .delete_namespaced_custom_object (
101+ # patch the namespaced custom object to update the `spec.cronSpec` field
102+ patch_resource = api .patch_namespaced_custom_object (
105103 group = "stable.example.com" ,
106104 version = "v1" ,
107105 name = "my-new-cron-object" ,
108106 namespace = "default" ,
109107 plural = "crontabs" ,
110- body = client . V1DeleteOptions () ,
108+ body = patch_body ,
111109 )
112- print ("Resource deleted " )
113-
110+ print ("Resource details: " )
111+ pprint ( patch_resource )
114112
115- # patch the namespaced custom object to update the `spec.cronSpec` field
116- patch_resource = api .patch_namespaced_custom_object (
113+ # delete it
114+ api .delete_namespaced_custom_object (
117115 group = "stable.example.com" ,
118116 version = "v1" ,
119117 name = "my-new-cron-object" ,
120118 namespace = "default" ,
121119 plural = "crontabs" ,
122- body = patch_body ,
120+ body = client . V1DeleteOptions () ,
123121 )
124- print ("Resource details:" )
125- pprint (patch_resource )
122+ print ("Resource deleted" )
126123
127124
128125if __name__ == "__main__" :
0 commit comments