pod

package
Version: v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCPodUpdated

func GCPodUpdated(client kubernetes.Interface, pod *corev1.Pod)

GCPodUpdated handles GC pod update. If GC pod is terminated, it will be deleted.

func IsGCPod

func IsGCPod(pod *corev1.Pod) bool

IsGCPod judges whether a pod is a GC pod by check whether it has label "gc.cyclone.dev".

func IsWorkloadPod added in v1.1.0

func IsWorkloadPod(pod *corev1.Pod) bool

IsWorkloadPod judges whether a pod is a workload pod by check whether it has label "workload.cyclone.dev".

Types

type Handler

type Handler struct {
	ClusterClient kubernetes.Interface
	Client        k8s.Interface
}

Handler ...

func NewHandler added in v1.1.0

func NewHandler(client k8s.Interface, clusterClient kubernetes.Interface) *Handler

NewHandler ...

func (*Handler) AddFinalizer added in v1.1.0

func (h *Handler) AddFinalizer(obj interface{}) (bool, error)

AddFinalizer adds a finalizer to the object and update the object to the Kubernetes.

func (*Handler) HandleFinalizer added in v1.1.0

func (h *Handler) HandleFinalizer(obj interface{}) error

HandleFinalizer does the finalizer key representing things.

func (*Handler) Reconcile added in v1.1.0

func (h *Handler) Reconcile(obj interface{}) (res controller.Result, err error)

Reconcile compares the actual state with the desired, and attempts to converge the two.

type Operator

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

Operator ...

func NewOperator

func NewOperator(clusterClient kubernetes.Interface, client k8s.Interface, pod *corev1.Pod) (*Operator, error)

NewOperator ...

func (*Operator) DetermineStatus

func (p *Operator) DetermineStatus(wfrOperator workflowrun.Operator)

DetermineStatus determines status of a stage and update WorkflowRun status accordingly. Because coordinator container is the last container running in the pod (it performs collect logs, artifacts, notify resource resolver to push resource), when the coordinator container have been finished (no matter Succeed or Failed), we need to update stage status, and take necessary actions to stop the pod.

func (*Operator) OnDelete

func (p *Operator) OnDelete() error

OnDelete handles the situation when a stage pod gotten delete. It updates corresponding WorkflowRun's status.

func (*Operator) OnUpdated

func (p *Operator) OnUpdated() error

OnUpdated ...

Jump to

Keyboard shortcuts

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