env

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKubeConfig = filepath.Join(homedir.HomeDir(), "/.kube/config")
View Source
var DefaultKudoHome = filepath.Join(homedir.HomeDir(), ".kudo")

DefaultKudoHome is the default KUDO_HOME. We put .kudo file in the same directory where k8s keeps its config files (..kube/config). The place is determined by homedir.HomeDir() method and is different from what os.UserHomeDir() returns.

View Source
var DefaultSettings = &Settings{
	Namespace:      "default",
	RequestTimeout: 0,
	Validate:       true,
}

DefaultSettings initializes the settings to its defaults

Functions

func GetClient added in v0.8.0

func GetClient(s *Settings) (*kudo.Client, error)

GetClient is a helper function that takes the Settings struct and returns a new KUDO Client

Types

type Settings

type Settings struct {
	// KubeConfig is the path to an explicit kubeconfig file. This overwrites the value in $KUBECONFIG
	KubeConfig string
	// Home is the local path to kudo home directory
	Home kudohome.Home
	// Namespace used when working with Kubernetes
	Namespace string
	// RequestTimeout is the timeout value (in seconds) when making API calls via the KUDO client
	RequestTimeout int64
	// Validate KUDO installation before creating a KUDO client
	Validate bool
}

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 added in v0.8.0

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