-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathwebhook_command.go
More file actions
25 lines (23 loc) · 769 Bytes
/
webhook_command.go
File metadata and controls
25 lines (23 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main
import (
"github.com/ccremer/clustercode/pkg/webhook"
"github.com/urfave/cli/v2"
)
func newWebhookCommand() *cli.Command {
command := &webhook.Command{}
return &cli.Command{
Name: "webhook",
Usage: "Start clustercode in admission controller mode",
Before: LogMetadata,
Action: func(ctx *cli.Context) error {
command.Log = AppLogger(ctx).WithName(ctx.Command.Name)
return command.Execute(ctx.Context)
},
Flags: []cli.Flag{
&cli.StringFlag{Name: "webhook-tls-cert-dir", EnvVars: envVars("WEBHOOK_TLS_CERT_DIR"), Required: true,
Usage: "Directory containing the certificates for the webhook server. It's expected to contain the 'tls.crt' and 'tls.key' files.",
Destination: &command.WebhookCertDir,
},
},
}
}