mutating

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MiddleResources = []schema.GroupVersionKind{
	{Group: "apps", Version: "v1", Kind: "ReplicaSet"},
}

MiddleResources is the list of resources that are considered as middle resources, such as ReplicaSet. We need to find the corresponding owner workload for these middle resources.

Functions

func NewMutatingHandler

func NewMutatingHandler() admission.Handler

NewMutatingHandler returns a new PodCreateUpdateHandler.

func RegisterHandler

func RegisterHandler(mgr manager.Manager)

RegisterHandler registers a handler to the webhook.

Types

type PodCreateUpdateHandler

type PodCreateUpdateHandler struct {
	*mixin.WebhookAdmissionHandlerMixin
}

PodCreateUpdateHandler handles Pod creation and update.

func (*PodCreateUpdateHandler) Handle

Handle handles admission requests. It will only handle Pod creation and update. It will query the workload that manages it via the pod's ownerReference, and then apply the processing label from the workload onto the pod. In special cases where the pod's ownerReference is a ReplicaSet, it will continue to query its ownerReference to find the corresponding Deployment workload.

Jump to

Keyboard shortcuts

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