env

package
v0.0.0-...-ef00259 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKubeConfig = filepath.Join(homedir.HomeDir(), "/.kube/config")
View Source
var DefaultSettings = &Settings{
	Namespace:      "default",
	RequestTimeout: 0,
}

DefaultSettings initializes the settings to its defaults

Functions

func KubeConfigHome

func KubeConfigHome() string

func NewClientSet

func NewClientSet(s *Settings) *kubernetes.Clientset

NewClientSet is a helper function that takes the Settings struct and returns a new kube Client

func NewRestClient

func NewRestClient(s *Settings) *rest.RESTClient

Types

type Settings

type Settings struct {
	// KubeConfig is the path to an explicit kubeconfig file. This overwrites the value in $KUBECONFIG
	KubeConfig string
	// Namespace used when working with Kubernetes
	Namespace string
	// RequestTimeout is the timeout value (in seconds) when making API calls
	RequestTimeout int64
}

Settings defines global variables and settings

func (*Settings) AddFlags

func (s *Settings) AddFlags(fs *pflag.FlagSet)

AddFlags binds flags to the given flagset.

func (*Settings) OverrideDefault

func (s *Settings) OverrideDefault(fs *pflag.FlagSet, name, value string) string

OverrideDefault used for deviations from global defaults

Jump to

Keyboard shortcuts

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