gvk

package
v0.13.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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.

func SupportsVerb

func SupportsVerb(verbs metav1.Verbs, want string) bool

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

type ResourceKey struct {
	Group     string
	Version   string
	Kind      string
	Namespace string
	Name      string
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL