mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 18:09:57 +00:00
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m26s
Post / coverage (push) Failing after 39m1s
Post / images (amd64) (push) Failing after 8m21s
Post / images (arm64) (push) Failing after 7m47s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 47s
Signed-off-by: Jian Qiu <jqiu@redhat.com>
27 lines
702 B
Go
27 lines
702 B
Go
package webhook
|
|
|
|
import (
|
|
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
|
|
|
|
clusterv1 "open-cluster-management.io/api/cluster/v1"
|
|
|
|
commonoptions "open-cluster-management.io/ocm/pkg/common/options"
|
|
internalv1 "open-cluster-management.io/ocm/pkg/registration/webhook/v1"
|
|
internalv1beta2 "open-cluster-management.io/ocm/pkg/registration/webhook/v1beta2"
|
|
)
|
|
|
|
func SetupWebhookServer(opts *commonoptions.WebhookOptions) error {
|
|
if err := opts.InstallScheme(
|
|
clientgoscheme.AddToScheme,
|
|
clusterv1.Install,
|
|
internalv1beta2.Install,
|
|
); err != nil {
|
|
return err
|
|
}
|
|
opts.InstallWebhook(
|
|
&internalv1.ManagedClusterWebhook{},
|
|
&internalv1beta2.ManagedClusterSetBindingWebhook{})
|
|
|
|
return nil
|
|
}
|