Files
open-cluster-management/pkg/cmd/webhook/option.go
DangPeng Liu 467124210c use controller runtime to implement webhook (#164)
Signed-off-by: ldpliu <daliu@redhat.com>

Signed-off-by: ldpliu <daliu@redhat.com>
2022-11-06 22:14:16 -05:00

24 lines
681 B
Go

package webhook
import "github.com/spf13/pflag"
// Config contains the server (the webhook) cert and key.
type Options struct {
Port int
CertDir string
}
// NewOptions constructs a new set of default options for webhook.
func NewOptions() *Options {
return &Options{
Port: 9443,
}
}
func (c *Options) AddFlags(fs *pflag.FlagSet) {
fs.IntVar(&c.Port, "port", c.Port,
"Port is the port that the webhook server serves at.")
fs.StringVar(&c.CertDir, "certdir", c.CertDir,
"CertDir is the directory that contains the server key and certificate. If not set, webhook server would look up the server key and certificate in {TempDir}/k8s-webhook-server/serving-certs")
}