kubectl

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiffManager

func NewDiffManager(config DiffManagerConfig) (manage.ResourceManager, error)

NewDiffManager returns a resource Manager based on Kubctl that will output diff changes.

func NewManager

func NewManager(config ManagerConfig) (manage.ResourceManager, error)

NewManager returns a resource Manager based on Kubctl that will apply changes.

Types

type CmdRunner

type CmdRunner interface {
	Run(*exec.Cmd) error
}

CmdRunner knows how to run exec.Cmd commands.

type DiffManagerConfig

type DiffManagerConfig struct {
	KubectlCmd                string
	KubeConfig                string
	KubeContext               string
	KubeFieldManager          string
	DisableKubeForceConflicts bool
	YAMLEncoder               K8sObjectEncoder
	FSManager                 FSManager
	CmdRunner                 CmdRunner
	Out                       io.Writer
	ErrOut                    io.Writer
	Logger                    log.Logger
}

DiffManagerConfig is the configuration for NewDiffManager.

type FSManager

type FSManager interface {
	TempDir(dir, pattern string) (name string, err error)
	RemoveAll(path string) error
	WriteFile(filename string, data []byte, perm os.FileMode) error
}

FSManager knows how to manage resources on the fs.

type K8sObjectEncoder

type K8sObjectEncoder interface {
	EncodeObjects(ctx context.Context, objs []model.K8sObject) ([]byte, error)
}

K8sObjectEncoder knows how to encode K8s objects into Raw Kubernetes compatible formats.

type ManagerConfig

type ManagerConfig struct {
	KubectlCmd                string
	KubeConfig                string
	KubeContext               string
	KubeFieldManager          string
	DisableKubeForceConflicts bool
	YAMLEncoder               K8sObjectEncoder
	CmdRunner                 CmdRunner
	Out                       io.Writer
	ErrOut                    io.Writer
	Logger                    log.Logger
}

ManagerConfig is the configuration for NewManager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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