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, )
| 49 | // ReloadDeployment finds and deletes the operator pod. Returns |
| 50 | // error if the new pod is not ready within a defined timeout |
| 51 | func 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 |
| 72 | func Dump(ctx context.Context, crudClient client.Client, namespace, filename string) { |
no test coverage detected