MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / Delete

Function Delete

tests/utils/objects/objects.go:61–77  ·  view source on GitHub ↗

Delete deletes an object in the Kubernetes cluster

(
	ctx context.Context,
	crudClient client.Client,
	object client.Object,
	opts ...client.DeleteOption,
)

Source from the content-addressed store, hash-verified

59
60// Delete deletes an object in the Kubernetes cluster
61func Delete(
62 ctx context.Context,
63 crudClient client.Client,
64 object client.Object,
65 opts ...client.DeleteOption,
66) error {
67 err := retry.New(retry.Delay(PollingTime*time.Second),
68 retry.Attempts(RetryAttempts),
69 retry.DelayType(retry.FixedDelay),
70 retry.RetryIf(func(err error) bool { return !errors.IsNotFound(err) })).
71 Do(
72 func() error {
73 return crudClient.Delete(ctx, object, opts...)
74 },
75 )
76 return err
77}
78
79// List retrieves a list of objects
80func List(

Calls 1

DeleteMethod · 0.45

Tested by 1