kubernetes

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const AnnotationLastApplied = "kubectl.kubernetes.io/last-applied-configuration"

AnnoationLastApplied is the last-applied-configuration annotation used by kubectl

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOpts

type ApplyOpts client.ApplyOpts

ApplyOpts allow set additional parameters for the apply operation

type DeleteOpts added in v0.10.0

type DeleteOpts client.DeleteOpts

type DiffOpts added in v0.4.0

type DiffOpts struct {
	// Use `diffstat(1)` to create a histogram of the changes instead
	Summarize bool
	// Find orphaned resources and include them in the diff
	WithPrune bool

	// Set the diff-strategy. If unset, the value set in the spec is used
	Strategy string
}

DiffOpts allow to specify additional parameters for diff operations

type Differ

type Differ func(manifest.List) (*string, error)

Differ is responsible for comparing the given manifests to the cluster and returning differences (if any) in `diff(1)` format.

func StaticDiffer added in v0.9.0

func StaticDiffer(create bool) Differ

StaticDiffer returns a differ that reports all resources as either created or deleted.

func SubsetDiffer added in v0.6.0

func SubsetDiffer(c client.Client) Differ

SubsetDiffer returns a implementation of Differ that computes the diff by comparing only the fields present in the desired state. This algorithm might miss information, but is all that's possible on cluster versions lower than 1.13.

type ErrorDiffStrategyUnknown added in v0.9.0

type ErrorDiffStrategyUnknown struct {
	Requested string
	// contains filtered or unexported fields
}

ErrorDiffStrategyUnknown occurs when a diff-strategy is requested that does not exist.

func (ErrorDiffStrategyUnknown) Error added in v0.9.0

func (e ErrorDiffStrategyUnknown) Error() string

type Kubernetes

type Kubernetes struct {
	Env v1alpha1.Environment
	// contains filtered or unexported fields
}

Kubernetes exposes methods to work with the Kubernetes orchestrator

func New

func New(env v1alpha1.Environment) (*Kubernetes, error)

New creates a new Kubernetes with an initialized client

func (*Kubernetes) Apply

func (k *Kubernetes) Apply(state manifest.List, opts ApplyOpts) error

Apply receives a state object generated using `Reconcile()` and may apply it to the target system

func (*Kubernetes) Close added in v0.9.0

func (k *Kubernetes) Close() error

Close runs final cleanup

func (*Kubernetes) Delete added in v0.10.0

func (k *Kubernetes) Delete(state manifest.List, opts DeleteOpts) error

func (*Kubernetes) Diff

func (k *Kubernetes) Diff(state manifest.List, opts DiffOpts) (*string, error)

Diff takes the desired state and returns the differences from the cluster

func (*Kubernetes) Info added in v0.6.0

func (k *Kubernetes) Info() client.Info

Info about the client, etc.

func (*Kubernetes) Orphaned added in v0.10.0

func (k *Kubernetes) Orphaned(state manifest.List) (manifest.List, error)

Orphaned returns previously created resources that are missing from the local state. It uses UIDs to safely identify objects.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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