PodMutator
No overview available.
Methods
Handle()
@classmethod
def Handle(
ctx: context.Context,
request: admission.Request
) - > admission.Response
Handles an admission request, applying mutations to the incoming Pod object. Callers use this to intercept and modify Pods before they are persisted in the Kubernetes API.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, used for cancellation and deadlines. |
| request | admission.Request | The admission request containing the Pod object to be mutated. |
Returns
| Type | Description |
|---|---|
admission.Response | An admission response indicating whether the request was allowed and any patches applied. |
Register()
@classmethod
def Register(
ctx: context.Context,
mgr: manager.Manager
) - > error
Registers the PodMutator with the controller manager, setting up necessary webhooks. Callers use this to integrate the mutator into the Kubernetes control plane.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the registration process. |
| mgr | manager.Manager | The controller manager instance to which the mutator will be registered. |
Returns
| Type | Description |
|---|---|
error | An error if the registration fails, otherwise nil. |
GetMutatePath()
@classmethod
def GetMutatePath() - > string
Retrieves the HTTP path where the mutation webhook is exposed. Callers use this to configure the MutatingWebhookConfiguration resource.
Returns
| Type | Description |
|---|---|
string | The URL path for the mutation webhook. |
CreateMutationWebhookConfiguration()
@classmethod
def CreateMutationWebhookConfiguration(
namespace: string
) - > *admissionregistrationv1.MutatingWebhookConfiguration, error
Creates a Kubernetes MutatingWebhookConfiguration object for the PodMutator. Callers use this to dynamically register the webhook with the Kubernetes API server.
Parameters
| Name | Type | Description |
|---|---|---|
| namespace | string | The Kubernetes namespace where the webhook service is deployed. |
Returns
| Type | Description |
|---|---|
*admissionregistrationv1.MutatingWebhookConfiguration, error | The created MutatingWebhookConfiguration object and an error if creation fails. |