GetPodName returns the name of the current operator pod NOTE: will return an error if the pod is being deleted
(ctx context.Context, crudClient client.Client)
| 278 | // GetPodName returns the name of the current operator pod |
| 279 | // NOTE: will return an error if the pod is being deleted |
| 280 | func GetPodName(ctx context.Context, crudClient client.Client) (string, error) { |
| 281 | pod, err := GetPod(ctx, crudClient) |
| 282 | if err != nil { |
| 283 | return "", err |
| 284 | } |
| 285 | |
| 286 | if pod.GetDeletionTimestamp() != nil { |
| 287 | return "", fmt.Errorf("pod is being deleted") |
| 288 | } |
| 289 | return pod.GetName(), nil |
| 290 | } |
| 291 | |
| 292 | // HasBeenUpgraded determines if the operator has been upgraded by checking |
| 293 | // if there is a deletion timestamp. If there isn't, it returns true |
no test coverage detected