pods

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package pods provides pod status for a namespace using kubectl. It supports both a snapshot as well as a continuous stream.

Index

Constants

View Source
const (
	PodPending   = corev1.PodPending   // Accepted but not all containers have started.
	PodRunning   = corev1.PodRunning   // All containers have started and at least one is running.
	PodSucceeded = corev1.PodSucceeded // All containers terminated without error.
	PodFailed    = corev1.PodFailed    // All containers terminated with at least one error.
)

Values for Phase. These constants are copied from k8s.io/api/core/v1 as a convenience.

Variables

This section is empty.

Functions

func WatchPodStatus

func WatchPodStatus(ctx context.Context, client kubernetes.Interface, namespace string) (chan *PodStatus, func(), error)

WatchPodStatus returns a channel on which the status of the pods in the supplied namespace are written.

Types

type ContainerStatus

type ContainerStatus struct {
	Name    string
	Image   string // path of requested image
	Ready   bool   // true if ready
	Reason  string // if not empty, the reason it isn't ready
	Message string // human readable reason
	Raw     *corev1.ContainerStatus
}

A ContainerStatus contains the status of a single container in the pod.

func (*ContainerStatus) Equal

func (c *ContainerStatus) Equal(oc *ContainerStatus) bool

func (*ContainerStatus) String

func (c *ContainerStatus) String() string

type PodStatus

type PodStatus struct {
	Name           string // name of pod
	UID            types.UID
	Namespace      string
	Phase          corev1.PodPhase // current phase
	Containers     []ContainerStatus
	InitContainers []ContainerStatus
	Pod            corev1.Pod // copy of the raw pod
}

A PodStatus represents the status of a single Pod.

func GetPodStatus

func GetPodStatus(ctx context.Context, client kubernetes.Interface, namespace string) ([]*PodStatus, error)

GetPodStatus returns the status of the pods found in the supplied namespace.

func PodToStatus

func PodToStatus(pod *corev1.Pod) *PodStatus

PodToStatus returns a pointer to a new PodStatus for pod.

func (*PodStatus) Equal

func (p *PodStatus) Equal(q *PodStatus) bool

func (*PodStatus) String

func (p *PodStatus) String() string

Jump to

Keyboard shortcuts

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