util

package
v1.34.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 36 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BooleanFormatError  = errors.New("Invalid format for boolean value.")
	BooleanNoValueError = errors.New("No value given.")
)
View Source
var AddOnEnvFlag = &flag.Flag{
	Name:      configCmd.AddonEnv.Name,
	Shorthand: "a",
	Usage:     "Specify key-value pairs to be added to the add-on interpolation context.",
	Value:     NewStringSliceValue([]string{}, &[]string{}),
}
View Source
var (
	DefaultAssets = []string{
		"anyuid",
		"admin-user",
		"xpaas",
		"registry-route",
		"che",
		"htpasswd-identity-provider",
		"admissions-webhook",
		"redhat-registry-login",
	}
)
View Source
var HttpProxyFlag = &flag.Flag{
	Name:      configCmd.HttpProxy.Name,
	Shorthand: "",
	Usage:     "HTTP proxy in the format http://<username>:<password>@<proxy_host>:<proxy_port>. Overrides potential HTTP_PROXY setting in the environment.",
	Value:     NewStringValue("", new(string)),
	DefValue:  "",
}
View Source
var HttpsProxyFlag = &flag.Flag{
	Name:      configCmd.HttpsProxy.Name,
	Shorthand: "",
	Usage:     "HTTPS proxy in the format https://<username>:<password>@<proxy_host>:<proxy_port>. Overrides potential HTTPS_PROXY setting in the environment.",
	Value:     NewStringValue("", new(string)),
	DefValue:  "",
}

Functions

func CacheOc added in v1.6.0

func CacheOc(openShiftVersion string) string

CacheOc ensures that the oc binary matching the requested OpenShift version is cached on the host

func CreateMinishiftDirs added in v1.32.0

func CreateMinishiftDirs(dirs *cmdState.MinishiftDirs)

func DetermineClusterUpParameters added in v1.29.0

func DetermineClusterUpParameters(config *clusterup.ClusterUpConfig, DockerbridgeSubnet string, clusterUpFlagSet *flag.FlagSet) map[string]string

determineClusterUpParameters returns a map of flag names and values for the cluster up call.

func DoesVMExist added in v1.10.0

func DoesVMExist(profileName string) bool

func EnsureConfigFileExists added in v1.32.0

func EnsureConfigFileExists(configPath string)

func ExitIfNotRunning

func ExitIfNotRunning(driver drivers.Driver, machineName string)

func ExitIfUndefined

func ExitIfUndefined(client *libmachine.Client, machineName string)

func GetBoolEnv added in v1.4.0

func GetBoolEnv(varName string) (bool, error)

GetBoolEnv returns truthy or falsy value of given environmental variable. It returns an error on failure with a default of false.

func GetNoProxyConfig added in v1.16.1

func GetNoProxyConfig(api libmachine.API) (string, string, error)

func GetOpenShiftReleaseVersion added in v1.23.0

func GetOpenShiftReleaseVersion() (string, error)

func GetVMStatus added in v1.6.0

func GetVMStatus(profileName string) string

func InitClusterUpFlags added in v1.29.0

func InitClusterUpFlags(commandName string) *flag.FlagSet

initClusterUpFlags creates the CLI flags which needs to be passed on to 'oc cluster up'

func IsHostRunning

func IsHostRunning(driver drivers.Driver) bool

func IsHostStopped added in v1.2.0

func IsHostStopped(driver drivers.Driver) bool

func IsValidProfile added in v1.6.0

func IsValidProfile(profileName string) bool

IsValidProfile return true if a given profile exist

func IsValidProfileName added in v1.10.0

func IsValidProfileName(profileName string) bool

IsValidProfileName return true if profile name follow ^[a-zA-Z0-9]+[\w+-]*$

func NewStringSliceValue added in v1.4.0

func NewStringSliceValue(val []string, p *[]string) *stringSliceValue

func NewStringValue added in v1.4.0

func NewStringValue(val string, p *string) *stringValue

func OcClusterDown added in v1.20.0

func OcClusterDown(hostVm *host.Host) error

OcClusterDown stop Openshift cluster using oc binary inside the remote machine

func PullOpenshiftImageAndCopyOcBinary added in v1.21.0

func PullOpenshiftImageAndCopyOcBinary(dockerCommander docker.DockerCommander, requestedOpenShiftVersion string) error

PullOpenshiftImageAndCopyOcBinary pull the openshift image if not available and then copy the client binary to Remote/VM machine Any occurring error is also returned.

func RemoveCurrentContext added in v1.10.0

func RemoveCurrentContext() error

RemoveCurrentContext removes the current context from `machinename_kubeconfig`

func ReplaceEnv added in v1.9.0

func ReplaceEnv(variables []string, varName string, value string) []string

ReplaceEnv changes the value of an environment variable It drops the existing value and appends the new value in-place

func SetOcContext added in v1.6.0

func SetOcContext(profileName string) error

func UnpackAddons added in v1.2.0

func UnpackAddons(addonsDir string) error

UnpackAddons will unpack the default addons into addons default dir

func VMExists

func VMExists(client *libmachine.Client, machineName string) bool

func ValidateGenericDriverFlags added in v1.20.0

func ValidateGenericDriverFlags(remoteIPAddress, remoteSSHUser, sshKeyToConnectRemote string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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