WaitForGetCluster will wait for a successful get cluster to be executed. Returns any error encountered.
(ctx context.Context, clusterObjectKey client.ObjectKey)
| 135 | // WaitForGetCluster will wait for a successful get cluster to be executed. |
| 136 | // Returns any error encountered. |
| 137 | func WaitForGetCluster(ctx context.Context, clusterObjectKey client.ObjectKey) error { |
| 138 | logger := log.FromContext(ctx).WithName("wait-for-get-cluster") |
| 139 | |
| 140 | cli, err := NewControllerRuntimeClient() |
| 141 | if err != nil { |
| 142 | logger.Error(err, "error while creating a standalone Kubernetes client") |
| 143 | return err |
| 144 | } |
| 145 | |
| 146 | return WaitForGetClusterWithClient(ctx, cli, clusterObjectKey) |
| 147 | } |
| 148 | |
| 149 | // WaitForGetClusterWithClient will wait for a successful get cluster to be executed |
| 150 | func WaitForGetClusterWithClient(ctx context.Context, cli client.Client, clusterObjectKey client.ObjectKey) error { |
no test coverage detected