mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-12 04:08:25 +00:00
25 lines
460 B
Go
25 lines
460 B
Go
package webhook
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"open-cluster-management.io/ocm/pkg/registration/webhook"
|
|
)
|
|
|
|
func NewRegistrationWebhook() *cobra.Command {
|
|
ops := webhook.NewOptions()
|
|
cmd := &cobra.Command{
|
|
Use: "webhook-server",
|
|
Short: "Start the registration webhook server",
|
|
RunE: func(c *cobra.Command, args []string) error {
|
|
err := ops.RunWebhookServer()
|
|
return err
|
|
},
|
|
}
|
|
|
|
flags := cmd.Flags()
|
|
ops.AddFlags(flags)
|
|
|
|
return cmd
|
|
}
|