getServiceOrNil gets a service with a certain name, returning nil when it doesn't exist
(ctx context.Context, r client.Client, objectKey client.ObjectKey)
| 192 | |
| 193 | // getServiceOrNil gets a service with a certain name, returning nil when it doesn't exist |
| 194 | func getServiceOrNil(ctx context.Context, r client.Client, objectKey client.ObjectKey) (*corev1.Service, error) { |
| 195 | var service corev1.Service |
| 196 | err := r.Get(ctx, objectKey, &service) |
| 197 | if err != nil { |
| 198 | if apierrs.IsNotFound(err) { |
| 199 | return nil, nil |
| 200 | } |
| 201 | |
| 202 | return nil, err |
| 203 | } |
| 204 | |
| 205 | return &service, nil |
| 206 | } |
| 207 | |
| 208 | // getServiceAccountOrNil gets a service account with a certain name, returning nil when it doesn't exist |
| 209 | func getServiceAccountOrNil( |
no test coverage detected