webhook

package
v3.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VwhName       = flag.String("validating-webhook-configuration-name", "gatekeeper-validating-webhook-configuration", "name of the ValidatingWebhookConfiguration")
	MwhName       = flag.String("mutating-webhook-configuration-name", "gatekeeper-mutating-webhook-configuration", "name of the MutatingWebhookConfiguration")
	TLSMinVersion = flag.String("tls-min-version", "1.3", "minimum version of TLS supported")
	ClientCAName  = flag.String("client-ca-name", "", "name of the certificate authority bundle to authenticate the Kubernetes API server requests against")
	CertCNName    = flag.String("client-cn-name", "kube-apiserver", "expected CN name on the client certificate attached by apiserver in requests to the webhook")
)
View Source
var AddToManagerFuncs []func(manager.Manager, Dependencies) error

AddToManagerFuncs is a list of functions to add all Controllers to the Manager.

View Source
var (
	ValidateTemplateRego = flag.Bool("validate-template-rego", true, "validate Rego code for constraint templates. Defaults to true. This flag will be removed in Gatekeeper v3.16 and cannot be used if `experimental-enable-k8s-native-validation` flag is set. Use Gator to validate in shift left manner to avoid impact with this behavior change.). Use Gator to validate in shift left manner to avoid impact with this behavior change.")
)

Functions

func AddLabelWebhook

func AddLabelWebhook(mgr manager.Manager, _ Dependencies) error

AddLabelWebhook registers the label webhook server with the manager.

func AddMutatingWebhook

func AddMutatingWebhook(mgr manager.Manager, deps Dependencies) error

AddMutatingWebhook registers the mutating webhook server with the manager.

func AddPolicyWebhook

func AddPolicyWebhook(mgr manager.Manager, deps Dependencies) error

AddPolicyWebhook registers the policy webhook server with the manager.

func AddToManager

func AddToManager(m manager.Manager, deps Dependencies) error

AddToManager adds all Controllers to the Manager.

func AppendMutationWebhookIfEnabled

func AppendMutationWebhookIfEnabled(webhooks []rotator.WebhookInfo) []rotator.WebhookInfo

func AppendValidationWebhookIfEnabled

func AppendValidationWebhookIfEnabled(webhooks []rotator.WebhookInfo) []rotator.WebhookInfo

func GetCertNameVerifier

func GetCertNameVerifier() func(cs tls.ConnectionState) error

func NewTLSChecker

func NewTLSChecker(certDir string, port int) func(*http.Request) error

Types

type Dependencies

type Dependencies struct {
	OpaClient       *constraintclient.Client
	ProcessExcluder *process.Excluder
	MutationSystem  *mutation.System
	ExpansionSystem *expansion.System
}

type StatsReporter

type StatsReporter interface {
	ReportValidationRequest(ctx context.Context, response requestResponse, isDryRun string, d time.Duration) error
	ReportMutationRequest(ctx context.Context, response requestResponse, d time.Duration) error
}

StatsReporter reports webhook metrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL