Skip to main content

InitCerts

Generates a self-signed TLS certificate for the webhook and stores it in a k8s Secret.

def InitCerts(
ctx: context.Context,
kubeClient: kubernetes.Interface,
cfg: *webhookConfig.Config
) - > error

Generates a self-signed TLS certificate for the webhook and stores it in a Kubernetes Secret.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for cancellation and deadlines.
kubeClientkubernetes.InterfaceThe Kubernetes client interface used to interact with the Kubernetes API, specifically for creating secrets.
cfg*webhookConfig.ConfigThe webhook configuration, containing details like the service name and the name of the secret to create.

Returns

TypeDescription
errorAn error if certificate generation or secret creation fails.