gvk

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource struct {
	Group      string
	Version    string
	Kind       string
	Resource   string
	Object     client.Object
	ObjectList client.ObjectList
}

Resource represents Kubernetes API resource metadata, and associates the concepts of group, version, kind, resource, client.Object, and client.ObjectList.

type ResourceGetter

type ResourceGetter struct {
	// contains filtered or unexported fields
}

ResourceGetter allows retrieval of Kubernetes API resource (including CRDs) metadata with optional filters. The returned metadata associates the concepts of group, version, kind, resource, client.Object, and client.ObjectList. The implementation uses the kube-apiserver resource discovery API.

func NewResourceGetter

func NewResourceGetter(
	scheme *runtime.Scheme,
	discoveryClient discovery.DiscoveryInterface,
) *ResourceGetter

NewResourceGetter returns a new ResourceGetter.

func (*ResourceGetter) Get

func (r *ResourceGetter) Get() ([]Resource, error)

Get returns the resources filtered by the specified criteria.

func (*ResourceGetter) WithCategories

func (r *ResourceGetter) WithCategories(categories ...string) *ResourceGetter

WithCategories filters for resources with the given categories. Reference: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#categories.

func (*ResourceGetter) WithGroups

func (r *ResourceGetter) WithGroups(groups ...string) *ResourceGetter

WithGroups filters for resources with the specified groups. Reference: https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning.

func (*ResourceGetter) WithScope

func (r *ResourceGetter) WithScope(scope meta.RESTScopeName) *ResourceGetter

WithScope filters for resources with the specified scope (either namespace or cluster scoped).

func (*ResourceGetter) WithVersions

func (r *ResourceGetter) WithVersions(versions ...string) *ResourceGetter

WithVersions filters for resources with the specified versions. Reference: https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning.

Jump to

Keyboard shortcuts

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