client

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package client is the client for kubeconfig

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MappingFor added in v0.4.0

func MappingFor(restMapper meta.RESTMapper, resourceOrKindArg string) (*meta.RESTMapping, error)

MappingFor returns the RESTMapping for the given resource or kind argument.

func MappingForResources added in v0.5.0

func MappingForResources(restMapper meta.RESTMapper, filters []string) ([]*meta.RESTMapping, []error)

MappingForResources is a wrapper of MappingFor.

func MatchGK added in v0.5.0

func MatchGK(arl []*metav1.APIResourceList, gvk schema.GroupKind) (gvr schema.GroupVersionResource, resource *metav1.APIResource, err error)

MatchGK returns the GroupVersionKind for the given resource name.

func MatchGVK added in v0.5.0

MatchGVK returns the GroupVersionKind for the given resource name.

func MatchShortResourceName added in v0.5.0

func MatchShortResourceName(arl []*metav1.APIResourceList, name string) (gvr schema.GroupVersionResource, resource *metav1.APIResource, err error)

MatchShortResourceName returns the GroupVersionResource for the given resource name.

Types

type Clientset

type Clientset interface {
	ToRESTConfig() (*rest.Config, error)
	ToRawKubeConfigLoader() clientcmd.ClientConfig
	ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
	ToRESTMapper() (meta.RESTMapper, error)
	ToDynamicClient() (dynamic.Interface, error)
	ToImpersonatingDynamicClient() DynamicClientImpersonator
}

Clientset is a set of Kubernetes clients.

func NewClientset

func NewClientset(masterURL, kubeconfigPath string, opts ...Option) (Clientset, error)

NewClientset creates a new clientset.

type DynamicClientImpersonator added in v0.5.0

type DynamicClientImpersonator interface {
	Impersonate(impersonateConfig rest.ImpersonationConfig) (dynamic.Interface, error)
}

type Option

type Option func(*clientset)

Option is a function that configures a clientset.

func WithImpersonate

func WithImpersonate(impersonateConfig rest.ImpersonationConfig) Option

WithImpersonate sets the impersonation config.

Jump to

Keyboard shortcuts

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