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

Function setUpWebhookServerRBAC

pkg/webhook/create.go:91–113  ·  view source on GitHub ↗

setUpWebhookServerRBAC sets required service account, cluster role, and cluster role binding for creating a webhook server

(ctx context.Context, err error, client crclient.Client, namespace string)

Source from the content-addressed store, hash-verified

89// setUpWebhookServerRBAC sets required service account, cluster role, and cluster role binding
90// for creating a webhook server
91func setUpWebhookServerRBAC(ctx context.Context, err error, client crclient.Client, namespace string) error {
92 // Set up the service account
93 log.Info("Setting up the webhook server service account")
94 err = CreateWebhookSA(client, ctx, namespace)
95 if err != nil {
96 return err
97 }
98
99 // Set up the cluster roles
100 log.Info("Setting up the webhook server cluster roles")
101 err = CreateWebhookClusterRole(client, ctx)
102 if err != nil {
103 return err
104 }
105
106 // Set up the cluster role binding
107 log.Info("Setting up the webhook server cluster role binding")
108 err = CreateWebhookClusterRoleBinding(client, ctx, namespace)
109 if err != nil {
110 return err
111 }
112 return nil
113}

Callers 1

SetupWebhooksFunction · 0.85

Calls 3

CreateWebhookSAFunction · 0.85
CreateWebhookClusterRoleFunction · 0.85

Tested by

no test coverage detected