kubernetes

package
v0.9.18 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateUnknown   = State(0)
	StatePending   = State(1)
	StateRunning   = State(2)
	StateSucceeded = State(3)
	StateFailed    = State(4)
)
View Source
const (
	CleanupModeOrphans = CleanupMode(0)
	CleanupModeDelete  = CleanupMode(1)
)

Variables

This section is empty.

Functions

func ConfigureKubeConfigFlags

func ConfigureKubeConfigFlags(hf common.HasFlags)

func GetObjectReference added in v0.6.0

func GetObjectReference(object runtime.Object, by ObjectValidator) (model.ObjectReference, error)

func GroupVersionKindToTypeMeta

func GroupVersionKindToTypeMeta(kind model.GroupVersionKind) metav1.TypeMeta

func HasServerDryRunSupport

func HasServerDryRunSupport(gvk model.GroupVersionKind, client dynamic.Interface, runtime Runtime) (bool, error)

func IsReady

func IsReady(object runtime.Object) *bool

func NewKubeClientConfig

func NewKubeClientConfig() (clientcmd.ClientConfig, string, error)

func OptimizeError

func OptimizeError(input error) error

func Pbool

func Pbool(v bool) *bool

func Pint32

func Pint32(v int32) *int32

func PrintLogs added in v0.6.0

func PrintLogs(ctx context.Context, using LogProvider, to WriterProvider) (err error)

func ResolveDryRun added in v0.6.0

func ResolveDryRun(in model.DryRunOn, gvk model.GroupVersionKind, client dynamic.Interface, runtime Runtime) (model.DryRunOn, error)

func TryCastToInt32

func TryCastToInt32(value interface{}) *int32

Types

type Aggregation

type Aggregation interface {
	Desired() *int64
	Ready() *int64
	UpToDate() *int64
	Available() *int64
	IsReady() *bool
	State() *State
}

func NewAggregationFor

func NewAggregationFor(object *unstructured.Unstructured) Aggregation

type AnonymousAggregation

type AnonymousAggregation struct {
	*unstructured.Unstructured
}

func (AnonymousAggregation) Available

func (instance AnonymousAggregation) Available() *int64

func (AnonymousAggregation) Desired

func (instance AnonymousAggregation) Desired() *int64

func (AnonymousAggregation) IsReady

func (instance AnonymousAggregation) IsReady() *bool

func (AnonymousAggregation) Ready

func (instance AnonymousAggregation) Ready() *int64

func (AnonymousAggregation) State added in v0.6.0

func (instance AnonymousAggregation) State() *State

func (AnonymousAggregation) UpToDate

func (instance AnonymousAggregation) UpToDate() *int64

type Apply

type Apply interface {
	Execute(scope string, dryRunOn model.DryRunOn) error
	Wait(scope string, wu model.WaitUntil) (relevantDuration time.Duration, err error)
	Rollback(scope string)
	String() string
}

type ApplyObject

type ApplyObject struct {
	KeepAliveInterval time.Duration
	// contains filtered or unexported fields
}

func NewApplyObject

func NewApplyObject(
	project *model.Project,
	source string,
	object *unstructured.Unstructured,
	client dynamic.Interface,
	runtime Runtime,
) (*ApplyObject, error)

func (*ApplyObject) Delete added in v0.6.0

func (instance *ApplyObject) Delete(scope string) (err error)

func (*ApplyObject) Execute

func (instance *ApplyObject) Execute(scope string, dryRunOn model.DryRunOn) (err error)

func (*ApplyObject) Rollback

func (instance *ApplyObject) Rollback(scope string)

func (ApplyObject) String

func (instance ApplyObject) String() string

func (*ApplyObject) Wait

func (instance *ApplyObject) Wait(scope string, global model.WaitUntil) (relevantDuration time.Duration, err error)

type ApplySet

type ApplySet []Apply

func (*ApplySet) Add

func (instance *ApplySet) Add(apply Apply)

func (ApplySet) Execute

func (instance ApplySet) Execute(scope string, dryRunOn model.DryRunOn) (err error)

func (ApplySet) Rollback

func (instance ApplySet) Rollback(scope string)

func (ApplySet) String

func (instance ApplySet) String() string

func (ApplySet) Wait

func (instance ApplySet) Wait(scope string, wu model.WaitUntil) (relevantDuration time.Duration, err error)

type CleanupMode added in v0.6.0

type CleanupMode uint8

func (CleanupMode) AffectedDescription added in v0.6.0

func (instance CleanupMode) AffectedDescription(plural bool, capitalize bool) (result string)

func (CleanupMode) String added in v0.6.0

func (instance CleanupMode) String() string

type CleanupTask added in v0.6.0

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

func NewCleanupTask added in v0.6.0

func NewCleanupTask(project *model.Project, client dynamic.Interface, mode CleanupMode) (CleanupTask, error)

func (*CleanupTask) Add added in v0.6.0

func (instance *CleanupTask) Add(reference model.ObjectReference)

func (*CleanupTask) Execute added in v0.6.0

func (instance *CleanupTask) Execute() error

func (*CleanupTask) ExecuteIn added in v0.6.0

func (instance *CleanupTask) ExecuteIn(namespace model.Namespace) (err error)

type DaemonSetAggregation

type DaemonSetAggregation struct {
	AnonymousAggregation
}

func (DaemonSetAggregation) Available

func (instance DaemonSetAggregation) Available() *int64

func (DaemonSetAggregation) Desired

func (instance DaemonSetAggregation) Desired() *int64

func (DaemonSetAggregation) IsReady

func (instance DaemonSetAggregation) IsReady() *bool

func (DaemonSetAggregation) Ready

func (instance DaemonSetAggregation) Ready() *int64

func (DaemonSetAggregation) State added in v0.6.0

func (instance DaemonSetAggregation) State() *State

func (DaemonSetAggregation) UpToDate

func (instance DaemonSetAggregation) UpToDate() *int64

type DeploymentAggregation

type DeploymentAggregation struct {
	AnonymousAggregation
}

func (DeploymentAggregation) Available

func (instance DeploymentAggregation) Available() *int64

func (DeploymentAggregation) Desired

func (instance DeploymentAggregation) Desired() *int64

func (DeploymentAggregation) IsReady

func (instance DeploymentAggregation) IsReady() *bool

func (DeploymentAggregation) Ready

func (instance DeploymentAggregation) Ready() *int64

func (DeploymentAggregation) State added in v0.6.0

func (instance DeploymentAggregation) State() *State

func (DeploymentAggregation) UpToDate

func (instance DeploymentAggregation) UpToDate() *int64

type LogProvider added in v0.6.0

type LogProvider interface {
	Open() (io.ReadCloser, error)
}

func LogProviderFor added in v0.6.0

func LogProviderFor(runtime Runtime, object kruntime.Object, container string) LogProvider

type ObjectInfo

type ObjectInfo struct {
	model.ObjectReference
	TypeMeta metav1.TypeMeta
	Resource schema.GroupVersionResource
}

func GetObjectInfo

func GetObjectInfo(object runtime.Object, by ObjectValidator) (ObjectInfo, error)

func (ObjectInfo) String

func (instance ObjectInfo) String() string

type ObjectResource

type ObjectResource struct {
	ObjectInfo
	Client   dynamic.Interface
	Resource dynamic.ResourceInterface
	Object   *unstructured.Unstructured
}

func GetObjectResource

func GetObjectResource(object *unstructured.Unstructured, client dynamic.Interface, by ObjectValidator) (ObjectResource, error)

func (ObjectResource) Clone added in v0.6.0

func (instance ObjectResource) Clone() ObjectResource

func (ObjectResource) CloneForCreate added in v0.6.0

func (instance ObjectResource) CloneForCreate(project *model.Project) (ObjectResource, error)

func (ObjectResource) CloneForUpdate added in v0.6.0

func (instance ObjectResource) CloneForUpdate(project *model.Project, original unstructured.Unstructured) (ObjectResource, error)

func (ObjectResource) Create

func (instance ObjectResource) Create(options *metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error)

func (ObjectResource) Delete

func (instance ObjectResource) Delete(options *metav1.DeleteOptions, subresources ...string) error

func (ObjectResource) Get

func (instance ObjectResource) Get(options *metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error)

func (ObjectResource) Update

func (instance ObjectResource) Update(options *metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error)

func (ObjectResource) Watch

func (instance ObjectResource) Watch(options *metav1.ListOptions) (watch.Interface, error)

type ObjectValidator added in v0.5.1

type ObjectValidator interface {
	IsNamespaced(what model.GroupVersionKind) *bool
}

type PodAggregation

type PodAggregation struct {
	AnonymousAggregation
}

func (PodAggregation) Available

func (instance PodAggregation) Available() *int64

func (PodAggregation) Desired

func (instance PodAggregation) Desired() *int64

func (PodAggregation) IsReady

func (instance PodAggregation) IsReady() *bool

func (PodAggregation) Ready

func (instance PodAggregation) Ready() *int64

func (PodAggregation) State added in v0.6.0

func (instance PodAggregation) State() *State

func (PodAggregation) UpToDate

func (instance PodAggregation) UpToDate() *int64

type PodLogProvider added in v0.6.0

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

func (*PodLogProvider) Open added in v0.6.0

func (instance *PodLogProvider) Open() (io.ReadCloser, error)

type Runtime

type Runtime interface {
	ContextName() string
	NewDynamicClient() (dynamic.Interface, error)
	NewRestClient(gvk schema.GroupVersionKind) (rest.Interface, error)

	discovery.OpenAPISchemaInterface
}

func NewRuntime

func NewRuntime() (Runtime, error)

type StagedApplySet added in v0.6.0

type StagedApplySet map[model.Stage]ApplySet

func (*StagedApplySet) Add added in v0.6.0

func (instance *StagedApplySet) Add(stage model.Stage, apply Apply)

func (StagedApplySet) Execute added in v0.6.0

func (instance StagedApplySet) Execute(scope string, dry model.DryRunOn, wu *model.WaitUntil, rollbackIfNeeded bool) (relevantDuration time.Duration, err error)

func (StagedApplySet) ExecuteStage added in v0.6.0

func (instance StagedApplySet) ExecuteStage(scope string, stage model.Stage, dryRunOn model.DryRunOn, wu *model.WaitUntil) (relevantDuration time.Duration, err error)

type State added in v0.6.0

type State uint8

func PState added in v0.6.0

func PState(in State) *State

func StateOf added in v0.6.0

func StateOf(object runtime.Object) *State

func (State) IsActive added in v0.6.0

func (instance State) IsActive() bool

func (State) IsDone added in v0.6.0

func (instance State) IsDone() bool

type StatefulSetAggregation

type StatefulSetAggregation struct {
	AnonymousAggregation
}

func (StatefulSetAggregation) Available

func (instance StatefulSetAggregation) Available() *int64

func (StatefulSetAggregation) Desired

func (instance StatefulSetAggregation) Desired() *int64

func (StatefulSetAggregation) IsReady

func (instance StatefulSetAggregation) IsReady() *bool

func (StatefulSetAggregation) Ready

func (instance StatefulSetAggregation) Ready() *int64

func (StatefulSetAggregation) State added in v0.6.0

func (instance StatefulSetAggregation) State() *State

func (StatefulSetAggregation) UpToDate

func (instance StatefulSetAggregation) UpToDate() *int64

type WriterProvider added in v0.6.0

type WriterProvider func() (io.WriteCloser, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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