Documentation ¶
Index ¶
- func AnnotationsEqual(current, desired *corev1.Secret) bool
- func CreateOrUpdate(ctx context.Context, c client.Client, s *corev1.Secret, equal EqualityFunc, ...) error
- func DataEqual(current, desired *corev1.Secret) bool
- func Delete(ctx context.Context, c client.Client, key client.ObjectKey) error
- func Get(ctx context.Context, c client.Client, key client.ObjectKey) (*corev1.Secret, error)
- func GetDataSHA256(ctx context.Context, c client.Client, key client.ObjectKey) string
- func MutateAnnotationsOnly(current, desired *corev1.Secret)
- func MutateDataOnly(current, desired *corev1.Secret)
- func New(name, namespace string, data map[string][]byte) *corev1.Secret
- type EqualityFunc
- type MutateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotationsEqual ¶
AnnotationsEqual returns true if the annotations of the two resources are the same.
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, s *corev1.Secret, equal EqualityFunc, mutate MutateFunc) error
CreateOrUpdate attempts first to get the given secret. If the secret does not exist, the secret will be created. Otherwise, if the secret exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
func GetDataSHA256 ¶
GetDataSHA256 returns the sha256 checksum of the secret data keys
func MutateAnnotationsOnly ¶
MutateAnnotationsOnly is a mutation function for secrets that only copies the annotations from desired to current.
func MutateDataOnly ¶
MutateDataOnly is a default mutation function for secrets that copies only the data field from desired to current.
Types ¶
type EqualityFunc ¶
EqualityFunc is the type for functions that compare two secrets. Return true if two secrets are equal.
type MutateFunc ¶
MutateFunc is the type for functions that mutate the current secret by applying the values from the desired secret.