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

Function DeleteSubscription

tests/utils/openshift/openshift.go:165–184  ·  view source on GitHub ↗

DeleteSubscription deletes the operator's subscription object

(
	ctx context.Context,
	crudClient client.Client,
)

Source from the content-addressed store, hash-verified

163
164// DeleteSubscription deletes the operator's subscription object
165func DeleteSubscription(
166 ctx context.Context,
167 crudClient client.Client,
168) error {
169 u := &unstructured.Unstructured{}
170 u.SetName("cloudnative-pg")
171 u.SetNamespace("openshift-operators")
172 u.SetGroupVersionKind(schema.GroupVersionKind{
173 Group: "operators.coreos.com",
174 Version: "v1alpha1",
175 Kind: "Subscription",
176 })
177
178 err := objects.Delete(ctx, crudClient, u)
179 if apierrors.IsNotFound(err) {
180 return nil
181 }
182
183 return err
184}
185
186// DeleteOperatorCRDs deletes the CRDs associated with the operator
187func DeleteOperatorCRDs(

Callers

nothing calls this directly

Calls 1

DeleteFunction · 0.92

Tested by

no test coverage detected