MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / getExistingClusterRole

Function getExistingClusterRole

pkg/webhook/cluster_roles.go:135–148  ·  view source on GitHub ↗
(ctx context.Context, client crclient.Client)

Source from the content-addressed store, hash-verified

133}
134
135func 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}

Callers 1

CreateWebhookClusterRoleFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected