cluster

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2018 License: Apache-2.0 Imports: 45 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

This section is empty.

Functions

func CollectObjects added in v0.11.0

func CollectObjects(namespace string, config clientcmd.ClientConfig) ([]*unstructured.Unstructured, error)

CollectObjects collects objects in a cluster namespace.

func DefaultResourceInfo added in v0.11.0

func DefaultResourceInfo(namespace string, config clientcmd.ClientConfig) *resource.Result

DefaultResourceInfo fetches objects from the cluster.

func ManagedObjects added in v0.11.0

func ManagedObjects(r ResourceInfo) ([]*unstructured.Unstructured, error)

ManagedObjects returns a slice of ksonnet managed objects.

func RebuildObject added in v0.11.0

func RebuildObject(m map[string]interface{}) (map[string]interface{}, error)

RebuildObject rebuilds the ksonnet generated object from an object on the cluster.

func RunApply

func RunApply(config ApplyConfig, opts ...ApplyOpts) error

RunApply runs apply against a cluster given a configuration.

func RunDelete

func RunDelete(config DeleteConfig, opts ...DeleteOpts) error

RunDelete runs delete against a cluster for a given configuration.

func RunShow

func RunShow(config ShowConfig, opts ...ShowOpts) error

RunShow shows objects for a given configuration.

func SetMetaDataAnnotation added in v0.11.0

func SetMetaDataAnnotation(obj metav1.Object, key, value string)

SetMetaDataAnnotation sets an annotation value

func SetMetaDataLabel added in v0.11.0

func SetMetaDataLabel(obj metav1.Object, key, value string)

SetMetaDataLabel sets a label value

func ShowYAML added in v0.11.0

func ShowYAML(out io.Writer, apiObjects []*unstructured.Unstructured) error

Types

type Apply

type Apply struct {
	ApplyConfig
	// contains filtered or unexported fields
}

Apply applies objects to the cluster

func (*Apply) Apply

func (a *Apply) Apply() error

Apply applies against a cluster.

type ApplyConfig

type ApplyConfig struct {
	App            app.App
	ClientConfig   *client.Config
	ComponentNames []string
	Create         bool
	DryRun         bool
	EnvName        string
	GcTag          string
	SkipGc         bool
}

ApplyConfig is configuration for Apply.

type ApplyOpts

type ApplyOpts func(a *Apply)

ApplyOpts are options for configuring Apply.

type Delete

type Delete struct {
	DeleteConfig
	// contains filtered or unexported fields
}

Delete deletes objects from the cluster.

func (*Delete) Delete

func (d *Delete) Delete() error

Delete deletes objects from a cluster.

type DeleteConfig

type DeleteConfig struct {
	App            app.App
	ClientConfig   *client.Config
	ComponentNames []string
	EnvName        string
	GracePeriod    int64
}

DeleteConfig is configuration for Delete.

type DeleteOpts

type DeleteOpts func(*Delete)

DeleteOpts is an option for configuring Delete.

type ObjectInfo

type ObjectInfo interface {
	ResourceName(d discovery.ServerResourcesInterface, o runtime.Object) string
}

ObjectInfo can retrieve information about an object.

type ResourceClient

type ResourceClient interface {
	Create() (*unstructured.Unstructured, error)
	Delete(options *metav1.DeleteOptions) error
	Get(options metav1.GetOptions) (*unstructured.Unstructured, error)
	Patch(pt types.PatchType, data []byte) (*unstructured.Unstructured, error)
}

ResourceClient is a wrapper for a resource client.

type ResourceInfo added in v0.11.0

type ResourceInfo interface {
	Err() error
	Infos() ([]*resource.Info, error)
}

ResourceInfo holds information about cluster resources.

type Show

type Show struct {
	ShowConfig
	// contains filtered or unexported fields
}

Show shows objects.

func (*Show) Show

func (s *Show) Show() error

Show shows objects.

type ShowConfig

type ShowConfig struct {
	App            app.App
	ComponentNames []string
	EnvName        string
	Format         string
	Out            io.Writer
}

ShowConfig is configuration for Show.

type ShowOpts

type ShowOpts func(*Show)

ShowOpts is an option for configuring Show.

Directories

Path Synopsis
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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