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. This function is used to initialize the necessary security credentials for the webhook to operate securely.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for controlling cancellation and timeouts. |
| kubeClient | kubernetes.Interface | The Kubernetes client interface used to interact with the Kubernetes API, specifically for creating secrets. |
| cfg | *webhookConfig.Config | The webhook configuration, containing details like the service name and the name of the secret to be created. |
Returns
| Type | Description |
|---|---|
error | An error if certificate generation or secret creation fails, otherwise nil. |