@@ -91,7 +91,6 @@ def __init__(
91
91
yaml_file = None ,
92
92
delete_timeout = TIMEOUT_4MINUTES ,
93
93
api_name = "pvc" ,
94
- delete_after_completion = None ,
95
94
** kwargs ,
96
95
):
97
96
"""
@@ -121,7 +120,6 @@ def __init__(
121
120
yaml_file (yaml, default: None): yaml file for the resource.
122
121
delete_timeout (int, default: 4 minutes): timeout associated with delete action.
123
122
api_name (str, default: "pvc"): api used for DV, pvc/storage
124
- delete_after_completion (str, default: None): annotation for garbage collector - "true"/"false"
125
123
"""
126
124
super ().__init__ (
127
125
name = name ,
@@ -148,7 +146,6 @@ def __init__(
148
146
self .bind_immediate_annotation = bind_immediate_annotation
149
147
self .preallocation = preallocation
150
148
self .api_name = api_name
151
- self .delete_after_completion = delete_after_completion
152
149
153
150
def to_dict (self ) -> None :
154
151
super ().to_dict ()
@@ -196,10 +193,6 @@ def to_dict(self) -> None:
196
193
}
197
194
if self .preallocation is not None :
198
195
self .res ["spec" ]["preallocation" ] = self .preallocation
199
- if self .delete_after_completion :
200
- self .res ["metadata" ].setdefault ("annotations" , {}).update ({
201
- f"{ self .api_group } /storage.deleteAfterCompletion" : (self .delete_after_completion )
202
- })
203
196
204
197
def wait_deleted (self , timeout = TIMEOUT_4MINUTES ):
205
198
"""
@@ -244,7 +237,6 @@ def scratch_pvc(self):
244
237
def _check_none_pending_status (self , failure_timeout = TIMEOUT_2MINUTES ):
245
238
# Avoid waiting for "Succeeded" status if DV's in Pending/None status
246
239
sample = None
247
- # if garbage collector is enabled, DV will be deleted after success
248
240
try :
249
241
for sample in TimeoutSampler (
250
242
wait_timeout = failure_timeout ,
@@ -270,18 +262,16 @@ def wait_for_dv_success(
270
262
self ,
271
263
timeout = TIMEOUT_10MINUTES ,
272
264
failure_timeout = TIMEOUT_2MINUTES ,
273
- dv_garbage_collection_enabled = False ,
274
265
stop_status_func = None ,
275
266
* stop_status_func_args ,
276
267
** stop_status_func_kwargs ,
277
268
):
278
269
"""
279
- Wait until DataVolume succeeded with or without DV Garbage Collection enabled
270
+ Wait until DataVolume succeeded
280
271
281
272
Args:
282
273
timeout (int): Time to wait for the DataVolume to succeed.
283
274
failure_timeout (int): Time to wait for the DataVolume to have not Pending/None status
284
- dv_garbage_collection_enabled (bool, default: False): if True, expect that DV will disappear after success
285
275
stop_status_func (function): function that is called inside the TimeoutSampler
286
276
if it returns True - stop the Sampler and raise TimeoutExpiredError
287
277
Example:
@@ -307,11 +297,8 @@ def test_dv():
307
297
wait_timeout = timeout ,
308
298
func = lambda : self .exists ,
309
299
):
310
- # DV reach success if the status is Succeeded, or if DV garbage collection enabled and the DV does not exist
311
300
if sample and sample .get ("status" , {}).get ("phase" ) == self .Status .SUCCEEDED :
312
301
break
313
- elif sample is None and dv_garbage_collection_enabled :
314
- break
315
302
elif stop_status_func and stop_status_func (* stop_status_func_args , ** stop_status_func_kwargs ):
316
303
raise TimeoutExpiredError (
317
304
value = (
@@ -339,8 +326,5 @@ def delete(self, wait=False, timeout=TIMEOUT_4MINUTES, body=None):
339
326
Returns:
340
327
bool: True if delete succeeded, False otherwise.
341
328
"""
342
- # if garbage collector is enabled, DV will be deleted after success
343
329
if self .exists :
344
330
return super ().delete (wait = wait , timeout = timeout , body = body )
345
- else :
346
- return self .pvc .delete (wait = wait , timeout = timeout , body = body )
0 commit comments