webhookconfig

package
v1.3.6-rc4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor added in v1.3.0

type Monitor struct {
	// contains filtered or unexported fields
}

Monitor stores the last webhook request time and monitors registered webhooks.

If a webhook is not received in the idleCheckInterval the monitor triggers a change in the Kyverno deployment to force a webhook request. If no requests are received after idleDeadline the webhooks are deleted and re-registered.

Webhook configurations are checked every tickerInterval. Currently the check only queries for the expected resource name, and does not compare other details like the webhook settings.

func NewMonitor added in v1.3.0

func NewMonitor(nsInformer informerv1.SecretInformer, log logr.Logger) *Monitor

NewMonitor returns a new instance of webhook monitor

func (*Monitor) Run added in v1.3.0

func (t *Monitor) Run(register *Register, certRenewer *tls.CertRenewer, eventGen event.Interface, stopCh <-chan struct{})

Run runs the checker and verify the resource update

func (*Monitor) SetTime added in v1.3.0

func (t *Monitor) SetTime(tm time.Time)

SetTime updates the last request time

func (*Monitor) Time added in v1.3.0

func (t *Monitor) Time() time.Time

Time returns the last request time

type Register added in v1.3.0

type Register struct {
	// contains filtered or unexported fields
}

Register manages webhook registration. There are five webhooks: 1. Policy Validation 2. Policy Mutation 3. Resource Validation 4. Resource Mutation 5. Webhook Status Mutation

func NewRegister added in v1.3.0

func NewRegister(
	clientConfig *rest.Config,
	client *client.Client,
	resCache resourcecache.ResourceCache,
	serverIP string,
	webhookTimeout int32,
	debug bool,
	log logr.Logger) *Register

NewRegister creates new Register instance

func (*Register) Check added in v1.3.0

func (wrc *Register) Check() error

Check returns an error if any of the webhooks are not configured

func (*Register) GetKubePolicyDeployment added in v1.3.5

func (wrc *Register) GetKubePolicyDeployment() (*apps.Deployment, *unstructured.Unstructured, error)

GetKubePolicyDeployment gets Kyverno deployment

func (*Register) GetWebhookTimeOut added in v1.3.0

func (wrc *Register) GetWebhookTimeOut() time.Duration

GetWebhookTimeOut returns the value of webhook timeout

func (*Register) Register added in v1.3.0

func (wrc *Register) Register() error

Register clean up the old webhooks and re-creates admission webhooks configs on cluster

func (*Register) Remove added in v1.3.0

func (wrc *Register) Remove(cleanUp chan<- struct{})

Remove removes all webhook configurations

Jump to

Keyboard shortcuts

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