Files
open-cluster-management/pkg/cmd/webhook/webhook.go
DangPeng Liu 1576fb0925 rewrite webhook using controller runtime (#278)
Signed-off-by: ldpliu <daliu@redhat.com>

Signed-off-by: ldpliu <daliu@redhat.com>
2022-11-02 06:43:25 -04:00

25 lines
477 B
Go

package webhook
import (
"github.com/spf13/cobra"
"open-cluster-management.io/registration/pkg/features"
)
func NewWebhook() *cobra.Command {
ops := NewOptions()
cmd := &cobra.Command{
Use: "webhook-server",
Short: "Start the webhook server",
RunE: func(c *cobra.Command, args []string) error {
err := ops.RunWebhookServer()
return err
},
}
flags := cmd.Flags()
ops.AddFlags(flags)
features.DefaultHubMutableFeatureGate.AddFlag(flags)
return cmd
}