kube

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 9 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 struct {
	Server string

	// if <0, no verbosity level is specified in the commands run
	LogLevel int
	// contains filtered or unexported fields
}

Client enables communication with the Kubernetes API Server through kubectl commands. The Server field enables discovery of the API server when kube-proxy is not configured (see README.md for more information).

func (*Client) Apply

func (c *Client) Apply(path string) (cmd, output string, err error)

Apply attempts to "kubectl apply" the file located at path. It returns the full apply command and its output.

func (*Client) CheckVersion

func (c *Client) CheckVersion() error

CheckVersion returns an error if the server and client have incompatible versions, otherwise returns nil.

func (*Client) Configure

func (c *Client) Configure() error

Configure writes the kubeconfig file to be used for authenticating kubectl commands.

type ClientInterface

type ClientInterface interface {
	Apply(string) (cmd, output string, err error)
	CheckVersion() error
}

ClientInterface allows for mocking out the functionality of Client when testing the full process of an apply run.

type MockClientInterface

type MockClientInterface struct {
	// contains filtered or unexported fields
}

Mock of ClientInterface interface

func NewMockClientInterface

func NewMockClientInterface(ctrl *gomock.Controller) *MockClientInterface

func (*MockClientInterface) Apply

func (_m *MockClientInterface) Apply(_param0 string) (string, string, error)

func (*MockClientInterface) CheckVersion

func (_m *MockClientInterface) CheckVersion() error

func (*MockClientInterface) EXPECT

func (_m *MockClientInterface) EXPECT() *_MockClientInterfaceRecorder

Jump to

Keyboard shortcuts

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