pod

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pod manipulates the k8s api of pod object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Pod)

Option configures a Pod

func WithK8sClient

func WithK8sClient(k8sClient kubernetes.Interface) Option

type Pod

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

Pod is the object to encapsulate docker

func New

func New(options ...Option) *Pod

New news a Pod

func (*Pod) Delete

func (p *Pod) Delete(namespace, name string) error

func (*Pod) Get

func (p *Pod) Get(namespace, name string) (*corev1.Pod, error)

Get gets a k8s pod

func (*Pod) GetNamespacedPodsStatus

func (p *Pod) GetNamespacedPodsStatus(pods []corev1.Pod, serviceName string) ([]PodStatus, error)

func (*Pod) ListAllNamespace

func (p *Pod) ListAllNamespace(fieldSelectors []string) (*corev1.PodList, error)

func (*Pod) ListNamespacePods

func (p *Pod) ListNamespacePods(namespace string) (*corev1.PodList, error)

func (*Pod) UnreadyPodReason

func (p *Pod) UnreadyPodReason(pod *corev1.Pod) (UnreadyReason, string)

func (*Pod) WatchAllNamespace

func (p *Pod) WatchAllNamespace(ctx context.Context, addFunc, modifyFunc, delFunc func(*corev1.Pod)) error

type PodStatus

type PodStatus struct {
	Reason  UnreadyReason
	Message string
}

type UnreadyReason

type UnreadyReason string
const (
	None                  UnreadyReason = "None"
	ImagePullFailed       UnreadyReason = "ImagePullFailed"
	InsufficientResources UnreadyReason = "InsufficientResources"
	Unschedulable         UnreadyReason = "Unschedulable"
	ProbeFailed           UnreadyReason = "ProbeFailed"
	ContainerCannotRun    UnreadyReason = "ContainerCannotRun"
)

Jump to

Keyboard shortcuts

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