kubectl

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Path = "kubectl"

Path is the path of the kubectl binary

Functions

This section is empty.

Types

type PrintRunner

type PrintRunner struct{}

PrintRunner implements Runner to return a []byte of the command to be executed

func (PrintRunner) ClusterInfo

func (r PrintRunner) ClusterInfo() ([]byte, error)

ClusterInfo returns the commands to kubectl

func (PrintRunner) Create

func (r PrintRunner) Create(stdin []byte) ([]byte, error)

Create returns the commands to kubectl

func (PrintRunner) Delete

func (r PrintRunner) Delete(name, ktype string) ([]byte, error)

Delete returns the commands to kubectl

func (PrintRunner) Get

func (r PrintRunner) Get(stdin []byte, ns string) ([]byte, error)

Get returns the commands to kubectl

func (PrintRunner) GetByKind

func (r PrintRunner) GetByKind(kind, name, ns string) (string, error)

GetByKind gets resources by kind, name(optional), and namespace(optional)

type RealRunner

type RealRunner struct{}

RealRunner implements Runner to execute kubectl commands

func (RealRunner) ClusterInfo

func (r RealRunner) ClusterInfo() ([]byte, error)

ClusterInfo returns Kubernetes cluster info

func (RealRunner) Create

func (r RealRunner) Create(stdin []byte) ([]byte, error)

Create uploads a chart to Kubernetes

func (RealRunner) Delete

func (r RealRunner) Delete(name, ktype string) ([]byte, error)

Delete removes a chart from Kubernetes.

func (RealRunner) Get

func (r RealRunner) Get(stdin []byte, ns string) ([]byte, error)

Get returns Kubernetes resources

func (RealRunner) GetByKind

func (r RealRunner) GetByKind(kind, name, ns string) (string, error)

GetByKind gets resources by kind, name(optional), and namespace(optional)

type Runner

type Runner interface {
	// ClusterInfo returns Kubernetes cluster info
	ClusterInfo() ([]byte, error)
	// Create uploads a chart to Kubernetes
	Create(stdin []byte) ([]byte, error)
	// Delete removes a chart from Kubernetes.
	Delete(name string, ktype string) ([]byte, error)
	// Get returns Kubernetes resources
	Get(stdin []byte, ns string) ([]byte, error)

	// GetByKind gets an entry by kind, name, and namespace.
	//
	// If name is omitted, all entries of that kind are returned.
	//
	// If NS is omitted, the default NS is assumed.
	GetByKind(kind, name, ns string) (string, error)
}

Runner is an interface to wrap kubectl convenience methods

var Client Runner = RealRunner{}

Client stores the instance of Runner

Jump to

Keyboard shortcuts

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