Skip to content

Commit 7224590

Browse files
committed
fix: webhooks.APITypes for Install()
1 parent c6950dd commit 7224590

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cmd/mcp-operator/app/app.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,20 @@ func (o *Options) runInit(ctx context.Context) error {
136136
installOptions := o.WebhooksFlags.InstallOptions
137137
installOptions = append(installOptions, webhooks.WithRemoteClient{Client: crateClient})
138138

139+
webhookTypes := []webhooks.APITypes{
140+
{
141+
Obj: &openmcpv1alpha1.ManagedControlPlane{},
142+
Validator: true,
143+
Defaulter: true,
144+
},
145+
}
146+
139147
// Install webhooks
140148
err = webhooks.Install(
141149
ctx,
142150
hostClient,
143151
sc,
144-
[]client.Object{
145-
&openmcpv1alpha1.ManagedControlPlane{},
146-
},
152+
webhookTypes,
147153
installOptions...,
148154
)
149155
if err != nil {

0 commit comments

Comments
 (0)