Documentation ¶
Index ¶
- func AnnotationsEqual(current, desired *corev1.ConfigMap) bool
- func Create(ctx context.Context, c client.Client, cm *corev1.ConfigMap) error
- func CreateOrUpdate(ctx context.Context, c client.Client, cm *corev1.ConfigMap, equal EqualityFunc, ...) (bool, error)
- func DataEqual(current, desired *corev1.ConfigMap) 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.ConfigMap, error)
- func GetDataSHA256(ctx context.Context, c client.Client, key client.ObjectKey, ...) string
- func LabelEqual(current, desired *corev1.ConfigMap) bool
- func MutateAnnotationsOnly(current, desired *corev1.ConfigMap)
- func MutateDataOnly(current, desired *corev1.ConfigMap)
- func New(name, namespace string, labels map[string]string, data map[string]string) *corev1.ConfigMap
- type EqualityFunc
- type MutateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotationsEqual ¶
AnnotationsEqual return only true if the configmaps have equal annotations sections only.
func Create ¶
Create will create the given configmap on the api server or return an error on failure
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, cm *corev1.ConfigMap, equal EqualityFunc, mutate MutateFunc) (bool, error)
CreateOrUpdate attempts first to get the given configmap. If the configmap does not exist, the configmap will be created. Otherwise, if the configmap 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. Returns true if the configmap was updated and false otherwise.
func GetDataSHA256 ¶
func GetDataSHA256(ctx context.Context, c client.Client, key client.ObjectKey, excludeKeys []string) string
GetDataSHA256 returns the sha256 checksum of the confimap data keys
func LabelEqual ¶
LabelEqual return only true if the configmaps have equal label sections only.
func MutateAnnotationsOnly ¶
MutateAnnotationsOnly is a default mutate function implementation that copies only the annotations section from desired to current configmap.
func MutateDataOnly ¶
MutateDataOnly is a default mutate function implementation that copies only the data section from desired to current configmap.
Types ¶
type EqualityFunc ¶
EqualityFunc is the type for functions that compare two configmaps. Return true if two configmaps are equal.
type MutateFunc ¶
MutateFunc is the type for functions that mutate the current configmap by applying the values from the desired configmap.