Documentation
¶
Index ¶
- func HasGVK(mapper meta.RESTMapper, gvk schema.GroupVersionKind) bool
- func NamespacedListableResources(resourceLists []*metav1.APIResourceList) ([]schema.GroupVersionResource, error)
- func ReplacePluralWithKind(discoveryClient *discovery.DiscoveryClient, gvk *schema.GroupVersionKind) error
- func SupportsVerb(verbs metav1.Verbs, want string) bool
- type ResourceID
- type ResourceKey
- type TenantResourceID
- type TenantResourceIDWithOrigin
- type VersionKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasGVK ¶
func HasGVK(mapper meta.RESTMapper, gvk schema.GroupVersionKind) bool
func NamespacedListableResources ¶
func NamespacedListableResources(resourceLists []*metav1.APIResourceList) ([]schema.GroupVersionResource, error)
func ReplacePluralWithKind ¶
func ReplacePluralWithKind(discoveryClient *discovery.DiscoveryClient, gvk *schema.GroupVersionKind) error
GetGVKByPlural returns the GroupVersionKind for a given plural name.
Types ¶
type ResourceID ¶
type ResourceID struct {
TenantResourceIDWithOrigin `json:",inline"`
Group string `json:"group,omitempty"`
Version string `json:"version,omitempty"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
}
ResourceID represents the decomposed parts of a Kubernetes resource identity.
func NewResourceID ¶
func NewResourceID(u *unstructured.Unstructured, tenant string, origin string) ResourceID
ResourceKey builds the canonical key string used for maps/sets. Non-namespaced objects will have "_" as the namespace component.
func (ResourceID) FieldOwner ¶
func (r ResourceID) FieldOwner(sep string) string
func (ResourceID) GetGVK ¶
func (r ResourceID) GetGVK() schema.GroupVersionKind
GVK returns the schema.GroupVersionKind of the resource.
func (ResourceID) GetGVKKey ¶
func (r ResourceID) GetGVKKey(sep string) string
func (ResourceID) GetKey ¶
func (r ResourceID) GetKey(sep string) string
func (ResourceID) GetName ¶
func (r ResourceID) GetName() string
func (ResourceID) GetNamespace ¶
func (r ResourceID) GetNamespace() string
type ResourceKey ¶
func KeyFromUnstructured ¶
func KeyFromUnstructured(o *unstructured.Unstructured) (ResourceKey, bool)
keyFromUnstructured builds a stable identity for dedupe. Prefer UID if you want “same object even if renamed” semantics; for Kubernetes resources name+namespace+GVK is typically what you want for “don’t process duplicates”.
type TenantResourceID ¶
type TenantResourceID struct {
Tenant string `json:"tenant,omitempty"`
}
type TenantResourceIDWithOrigin ¶
type TenantResourceIDWithOrigin struct {
TenantResourceID `json:",inline"`
Origin string `json:"origin,omitempty"`
}
type VersionKind ¶
type VersionKind struct {
// Kind of the referent.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`
// API version of the referent.
APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"`
}
func (VersionKind) GroupVersionKind ¶
func (s VersionKind) GroupVersionKind() schema.GroupVersionKind
Click to show internal directories.
Click to hide internal directories.