kubernetes

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

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
}

type Object added in v0.9.2

type Object client.Object

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

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