metadata

package
v0.23.2-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 138

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFor

func ConfigFor(inConfig *rest.Config) *rest.Config

ConfigFor returns a copy of the provided config with the appropriate metadata client defaults set.

Types

type Client

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

Client allows callers to retrieve the object metadata for any Kubernetes-compatible API endpoint. The client uses the meta.k8s.io/v1 PartialObjectMetadata resource to more efficiently retrieve just the necessary metadata, but on older servers (Kubernetes 1.14 and before) will retrieve the object and then convert the metadata.

func (*Client) Resource

func (c *Client) Resource(resource schema.GroupVersionResource) Getter

Resource returns an interface that can access cluster or namespace scoped instances of resource.

type Getter

type Getter interface {
	Namespace(string) ResourceInterface
	ResourceInterface
}

Getter handles both namespaced and non-namespaced resource types consistently.

type Interface

type Interface interface {
	Resource(resource schema.GroupVersionResource) Getter
}

Interface allows a caller to get the metadata (in the form of PartialObjectMetadata objects) from any Kubernetes compatible resource API.

func NewForConfig

func NewForConfig(inConfig *rest.Config) (Interface, error)

NewForConfig creates a new metadata client that can retrieve object metadata details about any Kubernetes object (core, aggregated, or custom resource based) in the form of PartialObjectMetadata objects, or returns an error. NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), where httpClient was generated with rest.HTTPClientFor(c).

func NewForConfigAndClient added in v0.23.0

func NewForConfigAndClient(inConfig *rest.Config, h *http.Client) (Interface, error)

NewForConfigAndClient creates a new metadata client for the given config and http client. Note the http client provided takes precedence over the configured transport values.

func NewForConfigOrDie

func NewForConfigOrDie(c *rest.Config) Interface

NewForConfigOrDie creates a new metadata client for the given config and panics if there is an error in the config.

type ResourceInterface

type ResourceInterface interface {
	Delete(ctx context.Context, name string, options metav1.DeleteOptions, subresources ...string) error
	DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error
	Get(ctx context.Context, name string, options metav1.GetOptions, subresources ...string) (*metav1.PartialObjectMetadata, error)
	List(ctx context.Context, opts metav1.ListOptions) (*metav1.PartialObjectMetadataList, error)
	Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
	Patch(ctx context.Context, name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*metav1.PartialObjectMetadata, error)
}

ResourceInterface contains the set of methods that may be invoked on objects by their metadata. Update is not supported by the server, but Patch can be used for the actions Update would handle.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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