package pod

import "github.com/oslokommune/okctl/pkg/kube/pod"

Package pod provides some reusable functions for interacting with the kubernetes pod API

Index

Types

type Pod

type Pod struct {
	Client  kubernetes.Interface
	Ctx     context.Context
	Timeout time.Duration
	Logger  *logrus.Logger
}

Pod contains the required state for interacting with the pod kubernetes API

func New

func New(ctx context.Context, logger *logrus.Logger, timeout time.Duration, client kubernetes.Interface) *Pod

New returns an initialised Pod client

func (*Pod) WaitFor

func (p *Pod) WaitFor(state State, pod *v1.Pod) error

WaitFor the desired state or return an error

type State

type State string

State enumerates the states we can handle

const (
	// StateDeleted means we want to wait for this state
	StateDeleted State = "deleted"
	// StateRunning means we want to wait for this state
	StateRunning State = "running"
)

Source Files

pod.go

Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
10 packages
Last checked
18 hours ago

Tools for package owners.