pod

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 12 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 an Pod

func WithCompleteParams

func WithCompleteParams(addr string, client *httpclient.HTTPClient) Option

WithCompleteParams provides an 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 an Pod

func (*Pod) Delete

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

func (*Pod) Get

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

Get gets a k8s pod

func (*Pod) GetNamespacedPodsStatus

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

func (*Pod) LimitedListAllNamespace

func (p *Pod) LimitedListAllNamespace(limit int, cont *string) (*apiv1.PodList, *string, error)

func (*Pod) ListAllNamespace

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

func (*Pod) ListNamespacePods

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

func (*Pod) UnreadyPodReason

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

func (*Pod) WatchAllNamespace

func (p *Pod) WatchAllNamespace(ctx context.Context, addfunc, updatefunc, deletefunc func(*apiv1.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