kubecfg

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnotationGcTag annotation that triggers
	// garbage collection. Objects with value equal to
	// command-line flag that are *not* in config will be deleted.
	AnnotationGcTag = "kubecfg.ksonnet.io/garbage-collect-tag"

	// AnnotationGcStrategy controls gc logic.  Current values:
	// `auto` (default if absent) - do garbage collection
	// `ignore` - never garbage collect this object
	AnnotationGcStrategy = "kubecfg.ksonnet.io/garbage-collect-strategy"

	// GcStrategyAuto is the default automatic gc logic
	GcStrategyAuto = "auto"
	// GcStrategyIgnore means this object should be ignored by garbage collection
	GcStrategyIgnore = "ignore"
)

Variables

View Source
var ErrDiffFound = fmt.Errorf("Differences found.")

Functions

This section is empty.

Types

type ApplyCmd

type ApplyCmd struct {
	ClientConfig *client.Config
	Env          string
	Create       bool
	GcTag        string
	SkipGc       bool
	DryRun       bool
}

ApplyCmd represents the apply subcommand

func (ApplyCmd) Run

func (c ApplyCmd) Run(apiObjects []*unstructured.Unstructured, wd string) error

Run applies the components to the designated environment cluster.

type Client

type Client struct {
	ClientPool dynamic.ClientPool
	Discovery  discovery.DiscoveryInterface
	Namespace  string
	// Name of the remote client to identify changes against. This field is Optional.
	Name string
	// APIObjects are the Kubernetes objects being diffed against
	APIObjects []*unstructured.Unstructured
}

Client holds the necessary information to connect with a remote Kubernetes cluster.

type ComponentListCmd added in v0.9.0

type ComponentListCmd struct {
}

ComponentListCmd stores the information necessary to display components.

func NewComponentListCmd added in v0.9.0

func NewComponentListCmd() *ComponentListCmd

NewComponentListCmd acts as a constructor for ComponentListCmd.

func (*ComponentListCmd) Run added in v0.9.0

func (c *ComponentListCmd) Run(out io.Writer) error

Run executes the displaying of components.

type ComponentRmCmd added in v0.9.0

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

ComponentRmCmd stores the information necessary to remove a component from the ksonnet application.

func NewComponentRmCmd added in v0.9.0

func NewComponentRmCmd(component string) *ComponentRmCmd

NewComponentRmCmd acts as a constructor for ComponentRmCmd.

func (*ComponentRmCmd) Run added in v0.9.0

func (c *ComponentRmCmd) Run() error

Run executes the removing of the component.

type DeleteCmd

type DeleteCmd struct {
	ClientConfig *client.Config
	Env          string
	GracePeriod  int64
}

DeleteCmd represents the delete subcommand

func (DeleteCmd) Run

func (c DeleteCmd) Run(apiObjects []*unstructured.Unstructured) error

type Diff

type Diff struct {
	DiffStrategy string
}

Diff is a base representation of the `diff` functionality.

type DiffCmd

type DiffCmd interface {
	Run(out io.Writer) error
}

DiffCmd is an interface containing a set of functions that allow diffing between two sets of data containing Kubernetes resouces.

type DiffLocalCmd

type DiffLocalCmd struct {
	Diff
	Env1 *LocalEnv
	Env2 *LocalEnv
}

DiffLocalCmd extends DiffCmd and is meant to represent diffing between two sets of Kubernetes objects.

func (*DiffLocalCmd) Run

func (c *DiffLocalCmd) Run(out io.Writer) error

type DiffRemoteCmd

type DiffRemoteCmd struct {
	Diff
	Client *Client
}

DiffRemoteCmd extends DiffCmd and is meant to represent diffing between some set of Kubernetes objects and the Kubernetes objects located on a remote client.

func (*DiffRemoteCmd) Run

func (c *DiffRemoteCmd) Run(out io.Writer) error

type DiffRemotesCmd

type DiffRemotesCmd struct {
	Diff
	ClientA *Client
	ClientB *Client
}

DiffRemotesCmd extends DiffCmd and is meant to represent diffing between the Kubernetes objects on two remote clients.

func (*DiffRemotesCmd) Run

func (c *DiffRemotesCmd) Run(out io.Writer) error

type EnvAddCmd

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

func NewEnvAddCmd

func NewEnvAddCmd(name, server, namespace, specFlag string, manager metadata.Manager) (*EnvAddCmd, error)

func (*EnvAddCmd) Run

func (c *EnvAddCmd) Run() error

type EnvListCmd

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

func NewEnvListCmd

func NewEnvListCmd(manager metadata.Manager) (*EnvListCmd, error)

func (*EnvListCmd) Run

func (c *EnvListCmd) Run(out io.Writer) error

type EnvRmCmd

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

func NewEnvRmCmd

func NewEnvRmCmd(name string, manager metadata.Manager) (*EnvRmCmd, error)

func (*EnvRmCmd) Run

func (c *EnvRmCmd) Run() error

type EnvSetCmd

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

func NewEnvSetCmd

func NewEnvSetCmd(name, desiredName string, manager metadata.Manager) (*EnvSetCmd, error)

func (*EnvSetCmd) Run

func (c *EnvSetCmd) Run() error

type InitCmd

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

func NewInitCmd

func NewInitCmd(name, rootPath string, k8sSpecFlag, serverURI, namespace *string) (*InitCmd, error)

func (*InitCmd) Run

func (c *InitCmd) Run() error

type LocalEnv

type LocalEnv struct {
	Name       string
	APIObjects []*unstructured.Unstructured
}

LocalEnv holds the local Kubernetes objects for an environment and relevant environment details, such as, environment name

type ParamDiffCmd

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

ParamDiffCmd stores the information necessary to diff between environment parameters.

func NewParamDiffCmd

func NewParamDiffCmd(fs afero.Fs, root, env1, env2, componentName string) *ParamDiffCmd

NewParamDiffCmd acts as a constructor for ParamDiffCmd.

func (*ParamDiffCmd) Run

func (c *ParamDiffCmd) Run(out io.Writer) error

Run executes the diffing of environment params.

type ParamListCmd

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

ParamListCmd stores the information necessary display component or environment parameters

func NewParamListCmd

func NewParamListCmd(component, env, nsName string) *ParamListCmd

NewParamListCmd acts as a constructor for ParamListCmd.

func (*ParamListCmd) Run

func (c *ParamListCmd) Run(out io.Writer) error

Run executes the displaying of params.

type ParamSetCmd

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

ParamSetCmd stores the information necessary to set component and environment params.

func NewParamSetCmd

func NewParamSetCmd(component, env, param, value string) *ParamSetCmd

NewParamSetCmd acts as a constructor for ParamSetCmd. It will also sanitize or "quote" the param value first if necessary.

func (*ParamSetCmd) Run

func (c *ParamSetCmd) Run() error

Run executes the setting of params.

type RegistryAddCmd added in v0.8.0

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

RegistryAddCmd contains the metadata needed to create a registry.

func NewRegistryAddCmd added in v0.8.0

func NewRegistryAddCmd(name, protocol, uri, version string) *RegistryAddCmd

NewRegistryAddCmd initializes a RegistryAddCmd.

func (*RegistryAddCmd) Run added in v0.8.0

func (c *RegistryAddCmd) Run() error

Run adds the registry to the ksonnet project.

type ShowCmd

type ShowCmd struct {
	Format string
}

ShowCmd represents the show subcommand

func (ShowCmd) Run

func (c ShowCmd) Run(apiObjects []*unstructured.Unstructured, out io.Writer) error

type ValidateCmd

type ValidateCmd struct {
	ClientConfig *client.Config
	Env          string
}

ValidateCmd represents the validate subcommand

func (ValidateCmd) Run

func (c ValidateCmd) Run(apiObjects []*unstructured.Unstructured, out io.Writer) error

Jump to

Keyboard shortcuts

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