Documentation ¶
Index ¶
- func AnnotationsEqual(current, desired *corev1.ServiceAccount) bool
- func CreateOrUpdate(ctx context.Context, c client.Client, sa *corev1.ServiceAccount, ...) error
- func Get(ctx context.Context, c client.Client, key client.ObjectKey) (*corev1.ServiceAccount, error)
- func MutateAnnotationsOnly(current, desired *corev1.ServiceAccount)
- func New(saName, namespace string, annotations map[string]string) *corev1.ServiceAccount
- type EqualityFunc
- type MutateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotationsEqual ¶
func AnnotationsEqual(current, desired *corev1.ServiceAccount) bool
AnnotationsEqual returns true only if the service account annotations are equal.
func CreateOrUpdate ¶
func CreateOrUpdate(ctx context.Context, c client.Client, sa *corev1.ServiceAccount, equal EqualityFunc, mutate MutateFunc) error
CreateOrUpdate attempts first to get the given serviceaccount. If the serviceaccount does not exist, the serviceaccount will be created. Otherwise, if the serviceaccount 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 Get ¶
func Get(ctx context.Context, c client.Client, key client.ObjectKey) (*corev1.ServiceAccount, error)
Get returns the k8s serviceacount for the given object key or an error.
func MutateAnnotationsOnly ¶
func MutateAnnotationsOnly(current, desired *corev1.ServiceAccount)
MutateAnnotationsOnly is a default mutate implementation that replaces current serviceaccount's annotations with the desired annotations.
Types ¶
type EqualityFunc ¶
type EqualityFunc func(current, desired *corev1.ServiceAccount) bool
EqualityFunc is the type for functions that compare two serviceaccounts. Return true if two deployment are equal.
type MutateFunc ¶
type MutateFunc func(current, desired *corev1.ServiceAccount)
MutateFunc is the type for functions that mutate the current serviceaccount by applying the values from the desired serviceaccount.