(ctx context.Context, client crclient.Client)
| 133 | } |
| 134 | |
| 135 | func getExistingClusterRole(ctx context.Context, client crclient.Client) (*v1.ClusterRole, error) { |
| 136 | clusterRole := &v1.ClusterRole{} |
| 137 | namespacedName := types.NamespacedName{ |
| 138 | Name: server.WebhookServerSAName, |
| 139 | } |
| 140 | err := client.Get(ctx, namespacedName, clusterRole) |
| 141 | if err != nil { |
| 142 | if apierrors.IsNotFound(err) { |
| 143 | return nil, nil |
| 144 | } |
| 145 | return nil, err |
| 146 | } |
| 147 | return clusterRole, nil |
| 148 | } |
no test coverage detected