reconciliation

package
v0.0.0-...-82207cb Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

TODO: describe package here.

Index

Constants

View Source
const (
	NameLabel = "app.kubernetes.io/name"
)

Variables

View Source
var (
	// Default value indicates no override. cf. comments in RandomID().
	OverrideID = ""
)

Functions

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns n securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GetControlledStructured

func GetControlledStructured(ctx context.Context, cl client.Client, owner runtime.Object, ownedList runtime.Object) (runtime.Object, error)

GetControlledStructured uses context ctx and client cl to find an object of the same (non-list) type as ownedList that is owned AND controlled by owner. The owned type must be a structured type. (Controlling owners must match the kind, apiversion and name of owner.) ownedList is only used internally.

func GetControlledUnstructured

func GetControlledUnstructured(ctx context.Context, c client.Client, ownerName string, ownerNamespace string, ownerGVK schema.GroupVersionKind, ownedGVK schema.GroupVersionKind, prune bool) ([]unstructured.Unstructured, error)

GetControlledUnstructured returns a list of (unstructured) objects with ownedGVK that are owned and controlled by the object with ownerName and ownerGVK in ownerNamespace. c is the reconciler involved. List is pruned to no more than a single object if prune is true.

func NeedsUpdate

func NeedsUpdate(log logr.Logger, actual, desired runtime.Object) bool

NeedsUpdate returns true if the actual object state has deviated from desired, indicating the actual should be updated. It will return false if the object is known to be in the process of being deleted.

func RandomID

func RandomID() string

RandomID generates a 4 character string valid for k8s name components. This can be overridden by giving OverrideID a non-empty value. This feature is intended for use only with tests.

func ReconcileStatefulServiceConditions

func ReconcileStatefulServiceConditions(existing, conditions []cloudstate.CloudstateCondition) []cloudstate.CloudstateCondition

If any of the conditions have changed, returns the list of conditions, otherwise returns an empty slice.

func SetCommonLabels

func SetCommonLabels(name string, labels map[string]string) map[string]string

func SetLastApplied

func SetLastApplied(desired runtime.Object)

SetLastApplied sets the last applied annotation to the value of the desired object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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