Documentation ¶
Index ¶
- Constants
- func GKNN(o client.Object) string
- func GKNNs(objs []client.Object) []string
- func GetAnnotation(obj client.Object, annotation string) string
- func GetLabel(obj client.Object, label string) string
- func NsReconcilerName(namespace, name string) string
- func ObjectNamespacedName(obj metav1.Object) types.NamespacedName
- func RemarshalToStructured(u *unstructured.Unstructured) (runtime.Object, error)
- func RemoveAnnotations(obj client.Object, annotations ...string)
- func RootReconcilerName(name string) string
- func SetAnnotation(obj Annotated, annotation, value string)
- func SetLabel(obj Labeled, label, value string)
- type Annotated
- type ID
- type Labeled
- type MetaMutator
- func Annotation(annotation, value string) MetaMutator
- func Annotations(annotations map[string]string) MetaMutator
- func CreationTimeStamp(ts metav1.Time) MetaMutator
- func DeletionGracePeriod(seconds int64) MetaMutator
- func DeletionTimestamp(ts metav1.Time) MetaMutator
- func Generation(gen int64) MetaMutator
- func Label(label, value string) MetaMutator
- func Labels(labels map[string]string) MetaMutator
- func Name(name string) MetaMutator
- func Namespace(namespace string) MetaMutator
- func OwnerReference(or []metav1.OwnerReference) MetaMutator
- func ResourceVersion(version string) MetaMutator
- func SelfLink(selfLink string) MetaMutator
- func UID(uid types.UID) MetaMutator
- func WithoutAnnotation(annotation string) MetaMutator
Constants ¶
const ( // NsReconcilerPrefix is the prefix used for all Namespace reconcilers. NsReconcilerPrefix = "ns-reconciler" // RootReconcilerPrefix is the prefix usef for all Root reconcilers. RootReconcilerPrefix = "root-reconciler" )
Variables ¶
This section is empty.
Functions ¶
func GKNN ¶
GKNN is used to set and verify the `configsync.gke.io/resource-id` annotation. Changing this function should be avoided, since it may introduce incompability across different Config Sync versions.
func GKNNs ¶
GKNNs returns the `configsync.gke.io/resource-id` annotations of th given objects as a string slice in increasing order.
func GetAnnotation ¶
GetAnnotation gets the annotation value on the passed annotated object for a given key.
func NsReconcilerName ¶
NsReconcilerName returns the namespace reconciler's name in the format: ns-reconciler-<namespace>-<name>-<name-length> If the RepoSync name is "repo-sync", it returns "ns-reconciler-<namespace>" for backward compatibility.
func ObjectNamespacedName ¶
func ObjectNamespacedName(obj metav1.Object) types.NamespacedName
ObjectNamespacedName returns the NamespacedName of the object.
func RemarshalToStructured ¶
func RemarshalToStructured(u *unstructured.Unstructured) (runtime.Object, error)
RemarshalToStructured converts a runtime.Object to the literal Go struct, if one is available. Returns an error if this process fails.
func RemoveAnnotations ¶
RemoveAnnotations removes the passed set of annotations from obj.
func RootReconcilerName ¶
RootReconcilerName returns the root reconciler's name in the format root-reconciler-<name>. If the RootSync name is "root-sync", it returns "root-reconciler" for backward compatibility.
func SetAnnotation ¶
SetAnnotation sets the annotation on the passed annotated object to value.
Types ¶
type Annotated ¶
type Annotated interface { GetAnnotations() map[string]string SetAnnotations(annotations map[string]string) }
Annotated is the interface defined by types with annotations. Note that some non-objects (such as PodTemplates) define annotations but are not objects.
type Labeled ¶
Labeled is the interface defined by types with labeled. Note that some non-objects (such as PodTemplates) define labels but are not objects.
type MetaMutator ¶
MetaMutator is a Mutator that modifies the metadata of an Object.
func Annotation ¶
func Annotation(annotation, value string) MetaMutator
Annotation adds annotation=value to the metadata.annotations of the MetaObject under test.
func Annotations ¶
func Annotations(annotations map[string]string) MetaMutator
Annotations sets the object's annotations to a copy of the passed map. Setting to nil causes a call to SetAnnotations(nil), but the underlying implementation may set Annotations to empty map.
func CreationTimeStamp ¶
func CreationTimeStamp(ts metav1.Time) MetaMutator
CreationTimeStamp sets the object's creation time stamp to the given value.
func DeletionGracePeriod ¶
func DeletionGracePeriod(seconds int64) MetaMutator
DeletionGracePeriod sets the object's deletion grace period to the given value.
func DeletionTimestamp ¶
func DeletionTimestamp(ts metav1.Time) MetaMutator
DeletionTimestamp sets the object's deletion timestamp to the given value.
func Generation ¶
func Generation(gen int64) MetaMutator
Generation replaces the metadata.generation of the Object under test.
func Label ¶
func Label(label, value string) MetaMutator
Label adds label=value to the metadata.labels of the Object under test.
func Labels ¶
func Labels(labels map[string]string) MetaMutator
Labels sets the object's labels to a copy of the passed map. Setting to nil causes a call to SetLabels(nil), but the underlying implementation may set Labels to empty map.
func Name ¶
func Name(name string) MetaMutator
Name replaces the metadata.name of the Object under test.
func Namespace ¶
func Namespace(namespace string) MetaMutator
Namespace replaces the metadata.namespace of the Object under test.
func OwnerReference ¶
func OwnerReference(or []metav1.OwnerReference) MetaMutator
OwnerReference sets the object's owner references to a passed slice of metav1.OwnerReference.
func ResourceVersion ¶
func ResourceVersion(version string) MetaMutator
ResourceVersion sets the object's resource version to the given value.
func SelfLink ¶
func SelfLink(selfLink string) MetaMutator
SelfLink sets the object's self link to the given value.
func UID ¶
func UID(uid types.UID) MetaMutator
UID replaces the metadata.uid of the Object under test.
func WithoutAnnotation ¶
func WithoutAnnotation(annotation string) MetaMutator
WithoutAnnotation removes annotation from metadata.annotations of the MetaObject under test.