secret

package
v0.0.0-...-81cd6e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotationsEqual

func AnnotationsEqual(current, desired *corev1.Secret) bool

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 DataEqual

func DataEqual(current, desired *corev1.Secret) bool

DataEqual returns true only if the data of current and desired are exactly same.

func Delete

func Delete(ctx context.Context, c client.Client, key client.ObjectKey) error

Delete attempts to delete a k8s secret if existing or returns an error.

func Get

Get returns the k8s secret for the given object key or an error.

func GetDataSHA256

func GetDataSHA256(ctx context.Context, c client.Client, key client.ObjectKey) string

GetDataSHA256 returns the sha256 checksum of the secret data keys

func MutateAnnotationsOnly

func MutateAnnotationsOnly(current, desired *corev1.Secret)

MutateAnnotationsOnly is a mutation function for secrets that only copies the annotations from desired to current.

func MutateDataOnly

func MutateDataOnly(current, desired *corev1.Secret)

MutateDataOnly is a default mutation function for secrets that copies only the data field from desired to current.

func New

func New(name, namespace string, data map[string][]byte) *corev1.Secret

New provides a k8s secret

Types

type EqualityFunc

type EqualityFunc func(current, desired *corev1.Secret) bool

EqualityFunc is the type for functions that compare two secrets. Return true if two secrets are equal.

type MutateFunc

type MutateFunc func(current, desired *corev1.Secret)

MutateFunc is the type for functions that mutate the current secret by applying the values from the desired secret.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL