Documentation
¶
Index ¶
- Variables
- func NewDiscoveryKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*disk.CachedDiscoveryClient, error)
- func NewDynamicKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*dynamic.DynamicClient, error)
- func NewKubeMapper(ctx context.Context, discoveryClient discovery.CachedDiscoveryInterface) meta.RESTMapper
- func NewStaticKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*kubernetes.Clientset, error)
- type ClientFactory
- func (f *ClientFactory) Discovery() discovery.CachedDiscoveryInterface
- func (f *ClientFactory) Dynamic() dynamic.Interface
- func (f *ClientFactory) KubeClient() KubeClienter
- func (f *ClientFactory) KubeConfig() *KubeConfig
- func (f *ClientFactory) LegacyClientGetter() *LegacyClientGetter
- func (f *ClientFactory) Mapper() meta.ResettableRESTMapper
- func (f *ClientFactory) Static() kubernetes.Interface
- type KubeClient
- func (c *KubeClient) Apply(ctx context.Context, resource *id.ResourceID, ...) (*unstructured.Unstructured, error)
- func (c *KubeClient) Create(ctx context.Context, resource *id.ResourceID, ...) (*unstructured.Unstructured, error)
- func (c *KubeClient) Delete(ctx context.Context, resource *id.ResourceID, opts KubeClientDeleteOptions) error
- func (c *KubeClient) Get(ctx context.Context, resource *id.ResourceID, opts KubeClientGetOptions) (*unstructured.Unstructured, error)
- func (c *KubeClient) MergePatch(ctx context.Context, resource *id.ResourceID, patch []byte) (*unstructured.Unstructured, error)
- type KubeClientApplyOptions
- type KubeClientCreateOptions
- type KubeClientDeleteOptions
- type KubeClientGetOptions
- type KubeClienter
- type KubeConfig
- type KubeConfigOptions
- type LegacyClientGetter
- func (g *LegacyClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (g *LegacyClientGetter) ToRESTConfig() (*rest.Config, error)
- func (g *LegacyClientGetter) ToRESTMapper() (meta.RESTMapper, error)
- func (g *LegacyClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultKubectlCacheDir = filepath.Join(homedir.HomeDir(), ".kube", "cache") KubectlCacheDirEnv = "KUBECACHEDIR" KubectlHttpCacheSubdir = "http" KubectlDiscoveryCacheSubdir = "discovery" )
Functions ¶
func NewDiscoveryKubeClientFromKubeConfig ¶
func NewDiscoveryKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*disk.CachedDiscoveryClient, error)
func NewDynamicKubeClientFromKubeConfig ¶
func NewDynamicKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*dynamic.DynamicClient, error)
func NewKubeMapper ¶
func NewKubeMapper(ctx context.Context, discoveryClient discovery.CachedDiscoveryInterface) meta.RESTMapper
func NewStaticKubeClientFromKubeConfig ¶
func NewStaticKubeClientFromKubeConfig(kubeConfig *KubeConfig) (*kubernetes.Clientset, error)
Types ¶
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
func NewClientFactory ¶
func NewClientFactory(ctx context.Context, kubeConfig *KubeConfig) (*ClientFactory, error)
func (*ClientFactory) Discovery ¶
func (f *ClientFactory) Discovery() discovery.CachedDiscoveryInterface
func (*ClientFactory) Dynamic ¶
func (f *ClientFactory) Dynamic() dynamic.Interface
func (*ClientFactory) KubeClient ¶
func (f *ClientFactory) KubeClient() KubeClienter
func (*ClientFactory) KubeConfig ¶
func (f *ClientFactory) KubeConfig() *KubeConfig
func (*ClientFactory) LegacyClientGetter ¶
func (f *ClientFactory) LegacyClientGetter() *LegacyClientGetter
func (*ClientFactory) Mapper ¶
func (f *ClientFactory) Mapper() meta.ResettableRESTMapper
func (*ClientFactory) Static ¶
func (f *ClientFactory) Static() kubernetes.Interface
type KubeClient ¶
type KubeClient struct {
// contains filtered or unexported fields
}
func NewKubeClient ¶
func NewKubeClient(staticClient kubernetes.Interface, dynamicClient dynamic.Interface, discoveryClient discovery.CachedDiscoveryInterface, mapper meta.ResettableRESTMapper) *KubeClient
func (*KubeClient) Apply ¶
func (c *KubeClient) Apply(ctx context.Context, resource *id.ResourceID, unstruct *unstructured.Unstructured, opts KubeClientApplyOptions) (*unstructured.Unstructured, error)
func (*KubeClient) Create ¶
func (c *KubeClient) Create(ctx context.Context, resource *id.ResourceID, unstruct *unstructured.Unstructured, opts KubeClientCreateOptions) (*unstructured.Unstructured, error)
func (*KubeClient) Delete ¶
func (c *KubeClient) Delete(ctx context.Context, resource *id.ResourceID, opts KubeClientDeleteOptions) error
func (*KubeClient) Get ¶
func (c *KubeClient) Get(ctx context.Context, resource *id.ResourceID, opts KubeClientGetOptions) (*unstructured.Unstructured, error)
func (*KubeClient) MergePatch ¶
func (c *KubeClient) MergePatch(ctx context.Context, resource *id.ResourceID, patch []byte) (*unstructured.Unstructured, error)
type KubeClientApplyOptions ¶
type KubeClientApplyOptions struct {
DryRun bool
}
type KubeClientCreateOptions ¶
type KubeClientCreateOptions struct {
ForceReplicas *int
}
type KubeClientDeleteOptions ¶
type KubeClientDeleteOptions struct {
PropagationPolicy *metav1.DeletionPropagation
}
type KubeClientGetOptions ¶
type KubeClientGetOptions struct {
TryCache bool
}
type KubeClienter ¶
type KubeClienter interface {
Get(ctx context.Context, resource *id.ResourceID, opts KubeClientGetOptions) (*unstructured.Unstructured, error)
Create(ctx context.Context, resource *id.ResourceID, unstruct *unstructured.Unstructured, opts KubeClientCreateOptions) (*unstructured.Unstructured, error)
Apply(ctx context.Context, resource *id.ResourceID, unstruct *unstructured.Unstructured, opts KubeClientApplyOptions) (*unstructured.Unstructured, error)
MergePatch(ctx context.Context, resource *id.ResourceID, patch []byte) (*unstructured.Unstructured, error)
Delete(ctx context.Context, resource *id.ResourceID, opts KubeClientDeleteOptions) error
}
type KubeConfig ¶
type KubeConfig struct {
LegacyClientConfig clientcmd.ClientConfig
Namespace string
RawConfig *api.Config
RestConfig *rest.Config
}
func NewKubeConfig ¶
func NewKubeConfig(ctx context.Context, kubeConfigPaths []string, opts KubeConfigOptions) (*KubeConfig, error)
type KubeConfigOptions ¶
type KubeConfigOptions struct {
AuthInfo string
BurstLimit int
CertificateAuthority string
ClientCertificate string
ClientKey string
Cluster string
CurrentContext string
DisableCompression bool
Impersonate string
ImpersonateGroups []string
ImpersonateUID string
InsecureSkipTLSVerify bool
KubeConfigBase64 string
Namespace string
Password string
QPSLimit int
Server string
TLSServerName string
Timeout string
Token string
Username string
}
type LegacyClientGetter ¶
type LegacyClientGetter struct {
// contains filtered or unexported fields
}
func NewLegacyClientGetter ¶
func NewLegacyClientGetter(discoveryClient discovery.CachedDiscoveryInterface, mapper meta.ResettableRESTMapper, restConfig *rest.Config, legacyClientConfig clientcmd.ClientConfig) *LegacyClientGetter
func (*LegacyClientGetter) ToDiscoveryClient ¶
func (g *LegacyClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
func (*LegacyClientGetter) ToRESTConfig ¶
func (g *LegacyClientGetter) ToRESTConfig() (*rest.Config, error)
func (*LegacyClientGetter) ToRESTMapper ¶
func (g *LegacyClientGetter) ToRESTMapper() (meta.RESTMapper, error)
func (*LegacyClientGetter) ToRawKubeConfigLoader ¶
func (g *LegacyClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
Click to show internal directories.
Click to hide internal directories.