(ctx context.Context, namespace string, client crclient.Client)
| 248 | } |
| 249 | |
| 250 | func getClusterDeployment(ctx context.Context, namespace string, client crclient.Client) (*appsv1.Deployment, error) { |
| 251 | deployment := &appsv1.Deployment{} |
| 252 | namespacedName := types.NamespacedName{ |
| 253 | Namespace: namespace, |
| 254 | Name: server.WebhookServerDeploymentName, |
| 255 | } |
| 256 | err := client.Get(ctx, namespacedName, deployment) |
| 257 | if err != nil { |
| 258 | if apierrors.IsNotFound(err) { |
| 259 | return nil, nil |
| 260 | } |
| 261 | return nil, err |
| 262 | } |
| 263 | return deployment, nil |
| 264 | } |
no test coverage detected