k8sconv

package
v0.20.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 10 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) v1alpha1.RuntimeStatus

func Pod added in v0.20.0

func Pod(ctx context.Context, pod *v1.Pod, ancestorUID types.UID) *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 of 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(mn model.ManifestName, podID k8s.PodID) logstore.SpanID

SpanIDForPod creates a span ID for a given pod associated with a manifest.

Generally, a given Pod is only referenced by a single manifest, but there are rare occasions where it can be referenced by multiple. If the span ID is not unique between them, things will behave erratically.

Types

This section is empty.

Jump to

Keyboard shortcuts

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