Documentation ¶
Index ¶
- Constants
- func CreateOrPatchSecret(ctx context.Context, h *helper.Helper, obj client.Object, ...) (string, controllerutil.OperationResult, error)
- func DeleteSecretsWithLabel(ctx context.Context, h *helper.Helper, obj client.Object, ...) error
- func DeleteSecretsWithName(ctx context.Context, h *helper.Helper, name string, namespace string) error
- func EnsureSecrets(ctx context.Context, h *helper.Helper, obj client.Object, sts []util.Template, ...) error
- func GetDataFromSecret(ctx context.Context, h *helper.Helper, secretName string, ...) (string, ctrl.Result, error)
- func GetSecret(ctx context.Context, h *helper.Helper, secretName string, ...) (*corev1.Secret, string, error)
- func GetSecrets(ctx context.Context, h *helper.Helper, secretNamespace string, ...) (*corev1.SecretList, error)
- func Hash(secret *corev1.Secret) (string, error)
- func VerifySecret(ctx context.Context, secretName types.NamespacedName, expectedFields []string, ...) (string, ctrl.Result, error)
Constants ¶
const ( // ReasonSecretMissing - secret does not exist ReasonSecretMissing condition.Reason = "SecretMissing" // ReasonSecretError - secret error ReasonSecretError condition.Reason = "SecretError" // ReasonSecretDeleteError - secret deletion error ReasonSecretDeleteError condition.Reason = "SecretDeleteError" )
Conditions for status in web console
Variables ¶
This section is empty.
Functions ¶
func CreateOrPatchSecret ¶
func CreateOrPatchSecret( ctx context.Context, h *helper.Helper, obj client.Object, secret *corev1.Secret, ) (string, controllerutil.OperationResult, error)
CreateOrPatchSecret - create custom secret or patch it, if one already exists finally return configuration hash
func DeleteSecretsWithLabel ¶
func DeleteSecretsWithLabel( ctx context.Context, h *helper.Helper, obj client.Object, labelSelectorMap map[string]string, ) error
DeleteSecretsWithLabel - Delete all secrets in namespace of the obj matching label selector
func DeleteSecretsWithName ¶
func DeleteSecretsWithName( ctx context.Context, h *helper.Helper, name string, namespace string, ) error
DeleteSecretsWithName - Delete names secret object in namespace
func EnsureSecrets ¶
func EnsureSecrets( ctx context.Context, h *helper.Helper, obj client.Object, sts []util.Template, envVars *map[string]env.Setter, ) error
EnsureSecrets - get all secrets required, verify they exist and add the hash to env and status
func GetDataFromSecret ¶
func GetDataFromSecret( ctx context.Context, h *helper.Helper, secretName string, requeueTimeout time.Duration, key string, ) (string, ctrl.Result, error)
GetDataFromSecret - Get data from Secret
if the secret or data is not found, requeue after requeueTimeout
func GetSecret ¶
func GetSecret( ctx context.Context, h *helper.Helper, secretName string, secretNamespace string, ) (*corev1.Secret, string, error)
GetSecret - get secret by name and namespace
func GetSecrets ¶
func GetSecrets( ctx context.Context, h *helper.Helper, secretNamespace string, labelSelectorMap map[string]string, ) (*corev1.SecretList, error)
GetSecrets - get secrets by namespace and label selectors
func Hash ¶
Hash function creates a hash of a Secret's Data and StringData fields and returns it as a safe encoded string.
func VerifySecret ¶
func VerifySecret( ctx context.Context, secretName types.NamespacedName, expectedFields []string, reader client.Reader, requeueTimeout time.Duration, ) (string, ctrl.Result, error)
VerifySecret - verifies if the Secret object exists and the expected fields are in the Secret. It returns a hash of the values of the expected fields.
Types ¶
This section is empty.