webhook

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package webhook provides the mutating admission webhook handler for rewriting secret volumes to point to shadow secrets.

Index

Constants

View Source
const (
	SecretName = "kloak-webhook-certs"
	CertKey    = "tls.crt"
	KeyKey     = "tls.key"
)
View Source
const (
	// LabelEnabled is the label used to enable Kloak on a pod or namespace.
	// Pod-level enablement uses a label (not annotation) so that Kubernetes
	// objectSelector can match it, allowing the webhook to be scoped precisely.
	LabelEnabled = "getkloak.io/enabled"

	// AnnotationEnabled is the annotation injected by the webhook onto mutated pods.
	// The controller (DaemonSet) reads this to determine if a pod is kloak-enabled.
	AnnotationEnabled = "getkloak.io/enabled"
)

Variables

This section is empty.

Functions

func EnsureWebhookCerts

func EnsureWebhookCerts(ctx context.Context, c client.Client, namespace string) ([]byte, error)

EnsureWebhookCerts generates a self-signed certificate for the mutating webhook if the secret does not already exist in the cluster.

func PatchWebhookConfiguration

func PatchWebhookConfiguration(ctx context.Context, c client.Client, certPEM []byte) error

Types

type Handler

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

func NewHandler

func NewHandler(c client.Client, log *zap.SugaredLogger) *Handler

func (*Handler) Handle

Handle processes admission requests for pods. The admission.Handler interface requires req by value — cannot use a pointer.

Jump to

Keyboard shortcuts

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