Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
NewMutatingHandler returns a new PodCreateUpdateHandler.
func RegisterHandler ¶
RegisterHandler registers a handler to the webhook.
Types ¶
type PodCreateUpdateHandler ¶
type PodCreateUpdateHandler struct {
*mixin.WebhookAdmissionHandlerMixin
}
PodCreateUpdateHandler handles Pod creation and update.
func (*PodCreateUpdateHandler) Handle ¶
func (h *PodCreateUpdateHandler) Handle(ctx context.Context, req admission.Request) admission.Response
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.