Documentation ¶
Index ¶
- func CopyToNamespace(ns string, oSecrets ...*corev1.Secret) []*corev1.Secret
- func CreateTLSSecret(ca *crypto.CA, ...) (*corev1.Secret, error)
- func GetEnvVarSource(secretName, key string, optional bool) *corev1.EnvVarSource
- func GetReferenceList(secrets []*corev1.Secret) []corev1.LocalObjectReference
- func ToRuntimeObjects(secrets ...*corev1.Secret) []client.Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyToNamespace ¶
CopyToNamespace returns a new list of secrets generated from the ones given but with the namespace changed to the given one.
func CreateTLSSecret ¶
func CreateTLSSecret( ca *crypto.CA, secretName, secretNamespace, secretKeyName, secretCertName string, dur time.Duration, cef []crypto.CertificateExtensionFunc, hostnames ...string, ) (*corev1.Secret, error)
CreateTLSSecret Creates a new TLS secret with the information passed
ca: The ca to use for creating the Cert/Key pair. This is required. secretName: The name of the secret. secretKeyName: The name of the data field that will contain the key. secretCertName: The name of the data field that will contain the cert. dur: How long the certificate will be valid. hostnames: The first will be used as the CN, and the rest as SANs. If no hostnames are provided then "localhost" will be used.
The first hostname provided is used as the common name for the certificate. If hostnames are not provided, localhost is used. This code came from: https://github.com/openshift/library-go/blob/84f02c4b7d6ab9d67f63b13586693600051de401/pkg/controller/controllercmd/cmd.go#L153
func GetEnvVarSource ¶
func GetEnvVarSource(secretName, key string, optional bool) *corev1.EnvVarSource
GetEnvVarSource returns an EnvVarSource using the given secret name and key.
func GetReferenceList ¶
func GetReferenceList(secrets []*corev1.Secret) []corev1.LocalObjectReference
GetReferenceList retrieves the object references from the secrets and returns that list.
Types ¶
This section is empty.