webhook

package
v2.0.9 Latest Latest
Warning

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

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

Documentation

Overview

Package webhook contains PodMutator. It's a controller-runtime webhook that intercepts Pod Creation events and mutates them. The SecretsMutator injects secret references into pods that have the inject-flyte-secrets label.

Index

Constants

View Source
const (
	PodNameEnvVar      = "POD_NAME"
	PodNamespaceEnvVar = "POD_NAMESPACE"
)
View Source
const (
	CaCertKey            = "ca.crt"
	ServerCertKey        = "tls.crt"
	ServerCertPrivateKey = "tls.key"
)

Variables

This section is empty.

Functions

func InitCerts

func InitCerts(ctx context.Context, kubeClient kubernetes.Interface, cfg *webhookConfig.Config) error

InitCerts generates a self-signed TLS certificate for the webhook and stores it in a k8s Secret.

func Setup

func Setup(ctx context.Context, kubeClient kubernetes.Interface, cfg *webhookConfig.Config,
	defaultNamespace string, scope promutils.Scope, mgr manager.Manager) error

Setup initializes the webhook: generates certs, registers MutatingWebhookConfiguration, and registers the HTTP handler. It is called before mgr.Start() so that the webhook server is ready to receive requests.

Types

type PodMutator

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

PodMutator implements controller-runtime WebHook interface.

func NewPodMutator

func NewPodMutator(ctx context.Context, cfg *webhookConfig.Config, podNamespace string, scheme *runtime.Scheme, scope promutils.Scope) (*PodMutator, error)

func (PodMutator) CreateMutationWebhookConfiguration

func (pm PodMutator) CreateMutationWebhookConfiguration(namespace string) (*admissionregistrationv1.MutatingWebhookConfiguration, error)

func (PodMutator) GetMutatePath

func (pm PodMutator) GetMutatePath() string

func (PodMutator) Handle

func (pm PodMutator) Handle(ctx context.Context, request admission.Request) admission.Response

func (PodMutator) Register

func (pm PodMutator) Register(ctx context.Context, mgr manager.Manager) error

Jump to

Keyboard shortcuts

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