util

package
v1.1.0-alpha.1....-acf7b57 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultErrorExitCode = 1
	PreFlightExitCode    = 2
	ValidationExitCode   = 3
)

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error)

CheckErr prints a user friendly error to STDERR and exits with a non-zero exit code. Unrecognized errors will be printed with an "error: " prefix.

This method is generic to the command in use and may be used by non-Kubectl commands.

func CreateClientAndWaitForAPI

func CreateClientAndWaitForAPI(file string) (*clientset.Clientset, error)

CreateClientAndWaitForAPI takes a path to a kubeconfig file, makes a client of it and waits for the API to be healthy

func KubernetesReleaseVersion

func KubernetesReleaseVersion(version string) (string, error)

KubernetesReleaseVersion is helper function that can fetch available version information from release servers based on label names, like "stable" or "latest".

If argument is already semantic version string, it will return same string.

In case of labels, it tries to fetch from release servers and then return actual semantic version.

Available names on release servers:

stable      (latest stable release)
stable-1    (latest stable release in 1.x)
stable-1.0  (and similarly 1.1, 1.2, 1.3, ...)
latest      (latest release, including alpha/beta)
latest-1    (latest release in 1.x, including alpha/beta)
latest-1.0  (and similarly 1.1, 1.2, 1.3, ...)

func KubernetesVersionToImageTag

func KubernetesVersionToImageTag(version string) string

KubernetesVersionToImageTag is helper function that replaces all non-allowed symbols in tag strings with underscores. Image tag can only contain lowercase and uppercase letters, digits, underscores, periods and dashes. Current usage is for CI images where all of symbols except '+' are valid, but function is for generic usage where input can't be always pre-validated.

func ParseTemplate

func ParseTemplate(strtmpl string, obj interface{}) ([]byte, error)

func WaitForAPI

func WaitForAPI(client clientset.Interface)

WaitForAPI waits for the API Server's /healthz endpoint to report "ok"

func WaitForPodsWithLabel

func WaitForPodsWithLabel(client clientset.Interface, labelKeyValPair string)

WaitForPodsWithLabel will lookup pods with the given label and wait until they are all reporting status as running.

Types

This section is empty.

Directories

Path Synopsis
Package pubkeypin provides primitives for x509 public key pinning in the style of RFC7469.
Package pubkeypin provides primitives for x509 public key pinning in the style of RFC7469.

Jump to

Keyboard shortcuts

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