webhookconfig

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package webhookconfig implements the webhook register and cert manager for the admission webhook.

Package webhookconfig implements the webhook register and cert manager for the admission webhook.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCertManager

func NewCertManager(
	clientConfig *rest.Config,
	certRenewer *varmortls.CertRenewer,
	secretInterface corev1.SecretInterface,
	secretInformer coreinformer.SecretInformer,
	stopCh <-chan struct{},
	log logr.Logger) *certManager

Types

type Register

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

Register manages webhook registration.

func NewRegister

func NewRegister(
	clientConfig *rest.Config,
	mutateInterface admissionv1.MutatingWebhookConfigurationInterface,
	validateInterface admissionv1.ValidatingWebhookConfigurationInterface,
	secretInterface corev1.SecretInterface,
	deploymentInterface appsv1.DeploymentInterface,
	leaseInterface coordinationv1.LeaseInterface,
	varmorInterface varmorinterface.CrdV1beta1Interface,
	mwcInformer adminformers.MutatingWebhookConfigurationInformer,
	vwcInformer adminformers.ValidatingWebhookConfigurationInformer,
	managerIP string,
	webhookTimeout int32,
	inContainer bool,
	stopCh <-chan struct{},
	log logr.Logger) *Register

NewRegister creates new Register instance

func (*Register) Check

func (wrc *Register) Check() error

Check returns an error if the webhooks of vArmor is not configured

func (*Register) Register

func (wrc *Register) Register() error

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

func (*Register) Remove

func (wrc *Register) Remove()

Remove removes the webhook configuration, secrets and leases

func (*Register) ShouldRemoveVarmorResources

func (wrc *Register) ShouldRemoveVarmorResources() bool

ShouldRemoveVarmorResources determines whether vArmor webhook resources should be cleaned up. This function checks the current state of the vArmor manager deployment to decide if cleanup is needed.

Returns:

  • true: Cleanup should be performed in the following scenarios: 1. Running outside of container environment (development/debug mode) 2. vArmor manager deployment not found in the cluster 3. vArmor manager deployment is being terminated 4. vArmor manager deployment is scaled to zero replicas
  • false: Cleanup should not be performed, typically when the manager is updating or running normally

Jump to

Keyboard shortcuts

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