package util

import "k8s.io/kubernetes/cmd/kubeadm/app/util"

Index

Constants

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

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 IsNodeAuthorizerSupported

func IsNodeAuthorizerSupported(k8sVersion *version.Version) bool

IsNodeAuthorizerSupported returns true if the provided version of kubernetes is able to use the Node Authorizer feature. There is a really nasty problem with the branching here and the timing of this feature implementation. When the release-1.7 branch was cut, two new tags were made: v1.7.0-beta.0 and v1.8.0-alpha.0. The Node Authorizer feature merged _after those cuts_. This means the minimum version we have to use is v1.7.0-beta.1. BUT since v1.8.0-alpha.0 sorts higher than v1.7.0-beta.1 (the actual version gate), we have to manually exclude v1.8.0-alpha.0 from this condition. v1.8.0-alpha.1 will indeed contain the patch.

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 ParseTemplate

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

Source Files

error.go template.go version.go

Directories

PathSynopsis
cmd/kubeadm/app/util/kubeconfig
cmd/kubeadm/app/util/token
Version
v1.7.13
Published
Feb 4, 2018
Platform
js/wasm
Imports
12 packages
Last checked
6 minutes ago

Tools for package owners.