mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-06 09:16:59 +00:00
26 lines
485 B
Go
26 lines
485 B
Go
package webhook
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
_ "open-cluster-management.io/ocm/pkg/features"
|
|
"open-cluster-management.io/ocm/pkg/work/webhook"
|
|
)
|
|
|
|
func NewWorkWebhook() *cobra.Command {
|
|
ops := webhook.NewOptions()
|
|
cmd := &cobra.Command{
|
|
Use: "webhook-server",
|
|
Short: "Start the work webhook server",
|
|
RunE: func(c *cobra.Command, args []string) error {
|
|
err := ops.RunWebhookServer()
|
|
return err
|
|
},
|
|
}
|
|
|
|
flags := cmd.Flags()
|
|
ops.AddFlags(flags)
|
|
|
|
return cmd
|
|
}
|