Documentation ¶
Index ¶
- Constants
- func BuildWorkstatusName(aw workv1.AppliedManifestWork, obj any) string
- func ConvertRuntimeObjectToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
- func CopyObjectMetaAndType(obj runtime.Object) runtime.Object
- func GenerateObjectInfoString(obj runtime.Object) string
- func GetGVR(mapper meta.RESTMapper, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
- func GetObjectFromKey(listers *SafeMap, key Key) (runtime.Object, error)
- func GetObjectStatusAsBytes(obj runtime.Object) ([]byte, error)
- func HasPrefixInMap(m map[string]string, prefix string) bool
- func IsAppliedManifestWork(o interface{}) bool
- func IsBeingDeleted(obj runtime.Object) bool
- func IsCRD(o interface{}) bool
- func IsListerNotFound(err error) bool
- func KeyForGroupVersionKind(group, version, kind string) string
- func ZeroFields(obj runtime.Object) runtime.Object
- type AppliedManifestInfo
- type Key
- type Names
- type SafeMap
- type SafeUIDMap
Constants ¶
const ( CRDKind = "CustomResourceDefinition" CRDGroup = "apiextensions.k8s.io" CRDVersion = "v1" ServiceVersion = "v1" ServiceKind = "Service" AnnotationToPreserveValuesKey = "annotations.kubestellar.io/preserve" PreserveNodePortValue = "nodeport" UnableToRetrieveCompleteAPIListError = "unable to retrieve the complete list of server APIs" AppliedManifestWorkKind = "AppliedManifestWork" AppliedManifestWorkResource = "appliedmanifestworks" )
Variables ¶
This section is empty.
Functions ¶
func BuildWorkstatusName ¶
func BuildWorkstatusName(aw workv1.AppliedManifestWork, obj any) string
BuildWorkstatusName builds a unique work status name from the applied manifest uid and manifestwork name
func ConvertRuntimeObjectToUnstructured ¶
func ConvertRuntimeObjectToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
func CopyObjectMetaAndType ¶
create a minimal runtime.Object copy with no spec and status for use with the delete
func GenerateObjectInfoString ¶
Used for generating a single string unique representation of the object for logging info
func GetGVR ¶
func GetGVR(mapper meta.RESTMapper, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
func IsAppliedManifestWork ¶
func IsAppliedManifestWork(o interface{}) bool
func IsBeingDeleted ¶
func IsListerNotFound ¶
func KeyForGroupVersionKind ¶
Create a string key in the form group/version/Kind or version/Kind if the group is empty
Types ¶
type AppliedManifestInfo ¶
type AppliedManifestInfo struct { ObjectUIDs []string GVRs []*schema.GroupVersionResource }
a struct to keep track of resources tracked in applied manifest work
func GetAddedRemovedInfo ¶
func GetAddedRemovedInfo(base AppliedManifestInfo, updated AppliedManifestInfo) (added, removed AppliedManifestInfo)
GetAddedRemovedInfo compares the updated AppliedManifestInfo to the base AppliedManifestInfo and returns AppliedManifestInfos for added and removed elements.
type Key ¶
Key struct used to add items to the workqueue. The key is used to identify the group/version/Kind of an object, used to index the listers for all objects, and the namespace/name key for the object. For deleted objects, since they are no longer in the cache, the key stores a shallow copy of the deleted object.
func KeyForGroupVersionKindNamespaceName ¶
Given an object that implements runtime.Object, create a key of type Key that contains the groupVersionKind key and name/namespace
type SafeMap ¶
type SafeMap struct {
// contains filtered or unexported fields
}
SafeMap provides a simple thread-safe map for concurrent access
func NewSafeMap ¶
func NewSafeMap() *SafeMap
func (*SafeMap) ListValues ¶
func (s *SafeMap) ListValues() []interface{}
type SafeUIDMap ¶
type SafeUIDMap struct {
// contains filtered or unexported fields
}
func NewSafeUIDMap ¶
func NewSafeUIDMap() *SafeUIDMap
func (*SafeUIDMap) AddUID ¶
func (s *SafeUIDMap) AddUID(key, uid string)
func (*SafeUIDMap) DeleteUID ¶
func (s *SafeUIDMap) DeleteUID(key, uid string)
func (*SafeUIDMap) GetUIDCount ¶
func (s *SafeUIDMap) GetUIDCount(key string) int