kubernetes

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRuntimeClientFromFileName added in v0.14.0

func NewRuntimeClientFromFileName(kubeConfigFilename string) (client.Client, error)

NewRuntimeClientFromFileName creates a new controller runtime client given a kubeconfig filename.

Types

type Client

type Client interface {
	Get(ctx context.Context, name, namespace string, obj Object) error
}

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

func (*KubeconfigClient) Get

func (c *KubeconfigClient) Get(ctx context.Context, name, namespace string, obj Object) error

Get performs a GET call to the kube API server and unmarshalls the response into the provided Object.

type KubectlGetter

type KubectlGetter interface {
	GetObject(ctx context.Context, resourceType, name, namespace, kubeconfig string, obj runtime.Object) error
	Delete(ctx context.Context, resourceType, name, namespace, kubeconfig string) error
	Apply(ctx context.Context, kubeconfig string, obj runtime.Object) error
}

type Object added in v0.9.2

type Object client.Object

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) Apply added in v0.12.0

func (c *UnAuthClient) Apply(ctx context.Context, kubeconfig string, obj runtime.Object) error

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.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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