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

Function ReloadDeployment

tests/utils/operator/operator.go:51–69  ·  view source on GitHub ↗

ReloadDeployment finds and deletes the operator pod. Returns error if the new pod is not ready within a defined timeout

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

Source from the content-addressed store, hash-verified

49// ReloadDeployment finds and deletes the operator pod. Returns
50// error if the new pod is not ready within a defined timeout
51func ReloadDeployment(
52 ctx context.Context,
53 crudClient client.Client,
54 timeoutSeconds uint,
55) error {
56 operatorPod, err := GetPod(ctx, crudClient)
57 if err != nil {
58 return err
59 }
60
61 err = crudClient.Delete(ctx, &operatorPod,
62 &client.DeleteOptions{GracePeriodSeconds: ptr.To(int64(1))},
63 )
64 if err != nil {
65 return err
66 }
67 // Wait for the operator pod to be ready
68 return WaitForReady(ctx, crudClient, timeoutSeconds, true)
69}
70
71// Dump logs the JSON for the deployment in an operator namespace, its pods and endpoints
72func Dump(ctx context.Context, crudClient client.Client, namespace, filename string) {

Callers 1

Calls 3

GetPodFunction · 0.85
WaitForReadyFunction · 0.70
DeleteMethod · 0.45

Tested by

no test coverage detected