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 for cancellation and deadlines.
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 to create an admission decoder for handling admission requests.
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 a secrets mutator, or an error if the secrets mutator creation fails.