Documentation ¶
Index ¶
- Constants
- Variables
- func AddAnnotations(obj Annotated, annotations map[string]string)
- func AddLabels(obj Labeled, labels map[string]string)
- func GKNN(o client.Object) string
- func GKNNs(objs []client.Object) []string
- func GetAnnotation(obj Annotated, annotation string) string
- func GetLabel(obj Labeled, label string) string
- func NsReconcilerName(namespace, name string) string
- func NsReconcilerObjectKey(namespace, syncName string) client.ObjectKey
- func ObjectNamespacedName(obj metav1.Object) types.NamespacedName
- func RemoveAnnotations(obj Annotated, annotations ...string)
- func RemoveLabels(obj Labeled, labels ...string)
- func RootReconcilerName(name string) string
- func RootReconcilerObjectKey(syncName string) client.ObjectKey
- func RootSyncName(reconcilerName 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 GenerateName(generateName string) 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 ¶
var Scheme = scheme.Scheme
Scheme is a reference to the global scheme. Use this Scheme to ensure you have all the required types added.
Functions ¶
func AddAnnotations ¶ added in v1.16.1
AddAnnotations adds the specified annotations to the object.
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 NsReconcilerObjectKey ¶ added in v1.16.0
NsReconcilerObjectKey returns an ObjectKey for interracting with the NsReconciler for the specified RepoSync.
func ObjectNamespacedName ¶
func ObjectNamespacedName(obj metav1.Object) types.NamespacedName
ObjectNamespacedName returns the NamespacedName of the object.
func RemoveAnnotations ¶
RemoveAnnotations removes the passed set of annotations from obj.
func RemoveLabels ¶ added in v1.19.0
RemoveLabels removes the passed set of labels 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 RootReconcilerObjectKey ¶ added in v1.16.0
RootReconcilerObjectKey returns an ObjectKey for interacting with the RootReconciler for the specified RootSync.
func RootSyncName ¶ added in v1.17.0
RootSyncName returns the RootSync's name given the name of its reconciler. It is the inverse of RootReconcilerName
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 ID ¶
ID uniquely identifies a resource on an API Server.
func IDOf ¶
IDOf converts an Object to its ID.
TODO: Replace usage with LookupID, unless explicitly Unstructured.
func RepoSyncID ¶ added in v1.19.1
RepoSyncID returns an ID for the specified RepoSync object.
func RootSyncID ¶ added in v1.19.1
RootSyncID returns an ID for the specified RootSync object.
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 GenerateName ¶ added in v1.17.0
func GenerateName(generateName string) MetaMutator
GenerateName replaces the metadata.generateName of the Object under test.
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.