util

package
v0.0.0-...-730bba4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PodCheckBudget is the maximum number of retries with 1s delays
	PodCheckBudget = 200
)

Variables

This section is empty.

Functions

func Compare

func Compare(content, golden []byte) error

Compare compares two byte slices. It returns an error with a contextual diff if they are not equal.

func CompareContent

func CompareContent(content []byte, goldenFile string, t *testing.T)

CompareContent compares the content value against the golden file

func CompareYAML

func CompareYAML(filename string, t *testing.T)

CompareYAML compares a file "x" against a golden file "x.golden"

func CopyPodFiles

func CopyPodFiles(container, pod, ns, source, dest string)

CopyPodFiles copies files from a pod to the machine

func CreateNamespace

func CreateNamespace(cl kubernetes.Interface) (string, error)

CreateNamespace creates a fresh namespace

func CreateNamespaceWithPrefix

func CreateNamespaceWithPrefix(cl kubernetes.Interface, prefix string, inject bool) (string, error)

CreateNamespaceWithPrefix creates a fresh namespace with the given prefix

func DeleteNamespace

func DeleteNamespace(cl kubernetes.Interface, ns string)

DeleteNamespace removes a namespace

func Eventually

func Eventually(name string, f func() bool, t *testing.T)

Eventually retries until f() returns true, or it times out in error

func FetchLogs

func FetchLogs(cl kubernetes.Interface, name, namespace string, container string) string

FetchLogs for a container in a a pod

func GetAppPods

func GetAppPods(cl kubernetes.Interface, kubeconfig string, nslist []string) (map[string][]string, error)

GetAppPods awaits till all pods are running in a namespace, and returns a map from "app" label value to the pod names.

func GetPods

func GetPods(cl kubernetes.Interface, ns string) []string

GetPods gets pod names in a namespace

func Refresh

func Refresh() bool

Refresh controls whether to update the golden artifacts instead. It is set using the environment variable REFRESH_GOLDEN.

func Run

func Run(command string) error

Run command and stream output

func RunInput

func RunInput(command, input string) error

RunInput command and pass input via stdin

func Shell

func Shell(command string) (string, error)

Shell out a command and aggregate output

Types

This section is empty.

Jump to

Keyboard shortcuts

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