kubecfg

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 35 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// AnnotationOrigObject annotation records the resource as it
	// was most recently specified by kubecfg (serialised to
	// JSON).  This is used as input to the strategic-merge-patch
	// 3-way merge when performing updates.
	AnnotationOrigObject = "kubecfg.ksonnet.io/last-applied-configuration"

	// AnnotationGcTag annotation that triggers
	// garbage collection. Objects with value equal to
	// command-line flag that are *not* in config will be deleted.
	//
	// NB: this is in phase1 of a migration to use a label instead.
	// At this stage, both label+migration are written, but the
	// annotation (only) is still used to trigger GC. [gctag-migration]
	AnnotationGcTag = LabelGcTag

	// LabelGcTag label that triggers garbage collection. Objects
	// with value equal to command-line flag that are *not* in
	// config will be deleted.
	//
	// NB: this is in phase1 of a migration from an annotation.
	// At this stage, both label+migration are written, but the
	// annotation (only) is still used to trigger GC. [gctag-migration]
	LabelGcTag = "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 DiffKeyValue = regexp.MustCompile(`"([-._a-zA-Z0-9]+)":\s"([[:alnum:]=+]+)",?`)
View Source
var DiffLineStart = regexp.MustCompile("(^|\n)(.)")

Matches all the line starts on a diff text, which is where we put diff markers and indent

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

Functions

This section is empty.

Types

type DeleteCmd added in v0.6.0

type DeleteCmd struct {
	Client           dynamic.Interface
	Mapper           meta.RESTMapper
	Discovery        discovery.DiscoveryInterface
	DefaultNamespace string

	GracePeriod int64
}

DeleteCmd represents the delete subcommand

func (DeleteCmd) Run added in v0.6.0

func (c DeleteCmd) Run(ctx context.Context, apiObjects []*unstructured.Unstructured) error

type DiffCmd added in v0.6.0

type DiffCmd struct {
	Client           dynamic.Interface
	Mapper           meta.RESTMapper
	DefaultNamespace string
	OmitSecrets      bool

	DiffStrategy string
}

DiffCmd represents the diff subcommand

func (DiffCmd) Run added in v0.6.0

func (c DiffCmd) Run(ctx context.Context, apiObjects []*unstructured.Unstructured, out io.Writer) error

type ShowCmd added in v0.6.0

type ShowCmd struct {
	Format string
}

ShowCmd represents the show subcommand

func (ShowCmd) Run added in v0.6.0

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

type UpdateCmd

type UpdateCmd struct {
	Client           dynamic.Interface
	Mapper           meta.RESTMapper
	Discovery        discovery.DiscoveryInterface
	DefaultNamespace string

	Create bool
	GcTag  string
	SkipGc bool
	DryRun bool
}

UpdateCmd represents the update subcommand

func (UpdateCmd) Run

func (c UpdateCmd) Run(ctx context.Context, apiObjects []*unstructured.Unstructured) error

Run executes the update command

type ValidateCmd added in v0.6.0

type ValidateCmd struct {
	Mapper        meta.RESTMapper
	Discovery     discovery.DiscoveryInterface
	IgnoreUnknown bool
}

ValidateCmd represents the validate subcommand

func (ValidateCmd) Run added in v0.6.0

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