Documentation ¶
Index ¶
- func NewRuntimeClientFromFileName(kubeConfigFilename string) (client.Client, error)
- type Client
- type ClientFactory
- type KubeconfigClient
- type KubectlGetter
- type Object
- type ObjectList
- type UnAuthClient
- func (c *UnAuthClient) Apply(ctx context.Context, kubeconfig string, obj runtime.Object) error
- func (c *UnAuthClient) Delete(ctx context.Context, name, namespace, kubeconfig string, obj runtime.Object) error
- func (c *UnAuthClient) Get(ctx context.Context, name, namespace, kubeconfig string, obj runtime.Object) error
- func (c *UnAuthClient) Init() error
- func (c *UnAuthClient) KubeconfigClient(kubeconfig string) Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientFactory ¶ added in v0.15.0
type ClientFactory struct{}
ClientFactory builds clients from a kubeconfig file by wrapping around NewRuntimeClientFromFileName to facilitate mocking.
func (ClientFactory) BuildClientFromKubeconfig ¶ added in v0.15.0
func (f ClientFactory) BuildClientFromKubeconfig(kubeconfigPath string) (client.Client, error)
BuildClientFromKubeconfig builds a K8s client from a kubeconfig file.
type KubeconfigClient ¶
type KubeconfigClient struct {
// contains filtered or unexported fields
}
KubeconfigClient is an authenticated kubernetes API client it authenticates using the credentials of a kubeconfig file.
func NewKubeconfigClient ¶
func NewKubeconfigClient(client *UnAuthClient, kubeconfig string) *KubeconfigClient
type KubectlGetter ¶
type ObjectList ¶ added in v0.12.0
type ObjectList client.ObjectList
type UnAuthClient ¶
type UnAuthClient struct {
// contains filtered or unexported fields
}
UnAuthClient is a generic kubernetes API client that takes a kubeconfig file on every call in order to authenticate.
func NewUnAuthClient ¶
func NewUnAuthClient(kubectl KubectlGetter) *UnAuthClient
func (*UnAuthClient) Delete ¶
func (c *UnAuthClient) Delete(ctx context.Context, name, namespace, kubeconfig string, obj runtime.Object) error
Delete performs a DELETE call to the kube API server authenticating with a kubeconfig file.
func (*UnAuthClient) Get ¶
func (c *UnAuthClient) Get(ctx context.Context, name, namespace, kubeconfig string, obj runtime.Object) error
Get performs a GET call to the kube API server authenticating with a kubeconfig file and unmarshalls the response into the provdied Object.
func (*UnAuthClient) Init ¶
func (c *UnAuthClient) Init() error
Init initializes the client internal API scheme It has always be invoked at least once before making any API call It is not thread safe.
func (*UnAuthClient) KubeconfigClient ¶
func (c *UnAuthClient) KubeconfigClient(kubeconfig string) Client
KubeconfigClient returns an equivalent authenticated client.