Documentation ¶
Index ¶
Constants ¶
const (
// PodNamespaceFile the file path and name for pod namespace
PodNamespaceFile = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
)
Variables ¶
var ErrExit = fmt.Errorf("exit")
ErrExit may be passed to CheckError to instruct it to output nothing but exit with status code 1.
Functions ¶
func CheckErr ¶ added in v0.0.44
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 CurrentContext ¶ added in v0.0.36
CurrentContext returns the current context
func CurrentNamespace ¶ added in v0.0.36
func CurrentNamespace() string
CurrentNamespace returns the current namespace in the context
func Fatal ¶ added in v0.0.44
Fatal prints the message (if provided) and then exits. If V(2) or greater, glog.Logger().Fatal is invoked for extended information.
func LoadConfig ¶ added in v0.0.36
func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
LoadConfig loads the Kubernetes configuration
func StandardErrorMessage ¶ added in v0.0.44
StandardErrorMessage translates common errors into a human readable message, or returns false if the error is not one of the recognized types. It may also log extended information to glog.
This method is generic to the command in use and may be used by non-Kubectl commands.
Types ¶
type Factory ¶
type Factory interface { // CreateKubeConfig creates the kubernetes configuration CreateKubeConfig() (*rest.Config, error) }
Factory is the interface defined for Kubernetes, Jenkins X, and Tekton REST APIs
func NewFactory ¶
func NewFactory() Factory
NewFactory creates a factory with the default Kubernetes resources defined