Skip to main content

NewPodMutator

No overview available.

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

Creates and initializes a new PodMutator instance. This function sets up the necessary components for mutating pods, including a secrets mutator.

Parameters​

NameTypeDescription
ctxcontext.ContextThe context for the operation, used to carry deadlines, cancellation signals, and other request-scoped values.
cfg*webhookConfig.ConfigThe webhook configuration settings to be used by the PodMutator.
podNamespacestringThe namespace where the pods are located, used for configuring the secrets mutator.
scheme*runtime.SchemeThe Kubernetes API scheme, used by the admission decoder to convert raw objects into typed Go objects.
scopepromutils.ScopeThe Prometheus metrics scope for reporting metrics related to the mutator's operations.

Returns​

TypeDescription
*PodMutator, errorA new PodMutator instance configured with a decoder, webhook configuration, and secrets mutator, or an error if the secrets mutator fails to initialize.