k8sconv

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Converts Kubernetes data models into our own internal data models.

(package name loosely inspired by strconv)

Index

Constants

This section is empty.

Variables

View Source
var ErrorWaitingReasons = map[string]bool{
	"CrashLoopBackOff":  true,
	"ErrImagePull":      true,
	"ImagePullBackOff":  true,
	"RunContainerError": true,
	"StartError":        true,
	"Error":             true,
}

Functions

func ContainerForStatus

func ContainerForStatus(pod *v1.Pod, cStatus v1.ContainerStatus) (v1alpha1.Container, error)

Convert a Kubernetes Pod and ContainerStatus into a simpler Container model to store in the engine state.

func ContainerStatusToRuntimeState

func ContainerStatusToRuntimeState(status v1alpha1.Container) model.RuntimeStatus

func Pod added in v0.20.0

func Pod(ctx context.Context, pod *v1.Pod) *v1alpha1.Pod

func PodConditions added in v0.19.7

func PodConditions(conditions []v1.PodCondition) []v1alpha1.PodCondition

func PodContainers

func PodContainers(ctx context.Context, pod *v1.Pod, containerStatuses []v1.ContainerStatus) []v1alpha1.Container

Convert a Kubernetes Pod into a list if simpler Container models to store in the engine state.

func PodStatusErrorMessages added in v0.20.0

func PodStatusErrorMessages(pod v1.Pod) []string

Pull out interesting error messages from the pod status

func PodStatusToString added in v0.20.0

func PodStatusToString(pod v1.Pod) string

copied from https://github.com/kubernetes/kubernetes/blob/aedeccda9562b9effe026bb02c8d3c539fc7bb77/pkg/kubectl/resource_printer.go#L692-L764 to match the status column of `kubectl get pods`

func SpanIDForPod added in v0.19.7

func SpanIDForPod(podID k8s.PodID) logstore.SpanID

Types

This section is empty.

Jump to

Keyboard shortcuts

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