serviceaccount

package
v0.0.0-...-a5c132e Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

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.

func New

func New(saName, namespace string, annotations map[string]string) *corev1.ServiceAccount

New returns a new k8s serviceaccount

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.

Jump to

Keyboard shortcuts

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