Documentation
¶
Overview ¶
TODO: describe package here.
Index ¶
- Constants
- Variables
- func GenerateRandomBytes(n int) ([]byte, error)
- func GetControlledStructured(ctx context.Context, cl client.Client, owner runtime.Object, ...) (runtime.Object, error)
- func GetControlledUnstructured(ctx context.Context, c client.Client, ownerName string, ownerNamespace string, ...) ([]unstructured.Unstructured, error)
- func NeedsUpdate(log logr.Logger, actual, desired runtime.Object) bool
- func RandomID() string
- func ReconcileStatefulServiceConditions(existing, conditions []cloudstate.CloudstateCondition) []cloudstate.CloudstateCondition
- func SetCommonLabels(name string, labels map[string]string) map[string]string
- func SetLastApplied(desired runtime.Object)
Constants ¶
const (
NameLabel = "app.kubernetes.io/name"
)
Variables ¶
var (
// Default value indicates no override. cf. comments in RandomID().
OverrideID = ""
)
Functions ¶
func GenerateRandomBytes ¶
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 ¶
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 SetLastApplied ¶
SetLastApplied sets the last applied annotation to the value of the desired object.
Types ¶
This section is empty.