deployment

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeploymentRolloutStatus

func DeploymentRolloutStatus(deployment *appsv1.Deployment, revision int64) (string, bool, error)

DeploymentRolloutStatus returns a message describing deployment status, and a bool value indicating if the status is considered done.

Types

type DeploymentStatus

type DeploymentStatus struct {
	appsv1.DeploymentStatus

	StatusGeneration uint64

	ReplicasIndicator  *indicators.Int32EqualConditionIndicator
	UpToDateIndicator  *indicators.Int32EqualConditionIndicator
	AvailableIndicator *indicators.Int32EqualConditionIndicator

	WaitingForMessages []string

	IsReady      bool
	IsFailed     bool
	FailedReason string

	Pods map[string]pod.PodStatus
	// New Pod belongs to the new ReplicaSet of the Deployment,
	// i.e. actual up-to-date Pod of the Deployment
	NewPodsNames []string
}

func NewDeploymentStatus

func NewDeploymentStatus(object *appsv1.Deployment, statusGeneration uint64, isTrackerFailed bool, trackerFailedReason string, podsStatuses map[string]pod.PodStatus, newPodsNames []string) DeploymentStatus

type Feed

type Feed interface {
	controller.ControllerFeed

	OnStatus(func(DeploymentStatus) error)

	GetStatus() DeploymentStatus
	Track(name, namespace string, kube kubernetes.Interface, opts tracker.Options) error
}

func NewFeed

func NewFeed() Feed

type PodAddedReport

type PodAddedReport struct {
	ReplicaSetPod    replicaset.ReplicaSetPod
	DeploymentStatus DeploymentStatus
}

type PodErrorReport

type PodErrorReport struct {
	ReplicaSetPodError replicaset.ReplicaSetPodError
	DeploymentStatus   DeploymentStatus
}

type ReplicaSetAddedReport

type ReplicaSetAddedReport struct {
	ReplicaSet       replicaset.ReplicaSet
	DeploymentStatus DeploymentStatus
}

type Tracker

type Tracker struct {
	tracker.Tracker

	State             tracker.TrackerState
	Conditions        []string
	NewReplicaSetName string

	TrackedPodsNames []string

	Added  chan DeploymentStatus
	Ready  chan DeploymentStatus
	Failed chan DeploymentStatus
	Status chan DeploymentStatus

	EventMsg        chan string
	AddedReplicaSet chan ReplicaSetAddedReport
	AddedPod        chan PodAddedReport
	PodLogChunk     chan *replicaset.ReplicaSetPodLogChunk
	PodError        chan PodErrorReport
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(name, namespace string, kube kubernetes.Interface, opts tracker.Options) *Tracker

func (*Tracker) Track

func (d *Tracker) Track(ctx context.Context) (err error)

Track starts tracking of deployment rollout process. watch only for one deployment resource with name d.ResourceName within the namespace with name d.Namespace Watcher can wait for namespace creation and then for deployment creation watcher receives added event if deployment is started watch is infinite by default there is option StopOnAvailable — if true, watcher stops after deployment has available status you can define custom stop triggers using custom implementation of ControllerFeed.

Jump to

Keyboard shortcuts

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