func ConfigFor(inConfig *rest.Config) *rest.Config
ConfigFor returns a copy of the provided config with the appropriate metadata client defaults set.
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.
type Client struct {
// contains filtered or unexported fields
}
func (c *Client) Resource(resource schema.GroupVersionResource) Getter
Resource returns an interface that can access cluster or namespace scoped instances of resource.
Getter handles both namespaced and non-namespaced resource types consistently.
type Getter interface { Namespace(string) ResourceInterface ResourceInterface }
Interface allows a caller to get the metadata (in the form of PartialObjectMetadata objects) from any Kubernetes compatible resource API.
type Interface interface { Resource(resource schema.GroupVersionResource) Getter }
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(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(c *rest.Config) Interface
NewForConfigOrDie creates a new metadata client for the given config and panics if there is an error in the config.
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.
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) }
Name | Synopsis |
---|---|
.. | |
fake | |
metadatainformer | |
metadatalister |