Documentation
¶
Overview ¶
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Copyright (c) 2012-2019 Red Hat, Inc. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
Index ¶
- Variables
- func CompareResources(actualDeployment *appsv1.Deployment, expected TestExpectedResources, ...)
- func ContainsString(slice []string, s string) bool
- func DetectOpenShift() (isOpenshift bool, isOpenshift4 bool, anError error)
- func DoRemoveString(slice []string, s string) (result []string)
- func FindEnv(envs []corev1.EnvVar, name string) *corev1.EnvVar
- func FindVolume(volumes []corev1.Volume, name string) corev1.Volume
- func FindVolumeMount(volumes []corev1.VolumeMount, name string) corev1.VolumeMount
- func GeneratePasswd(stringLength int) (passwd string)
- func GetArchitectureDependentEnv(env string) string
- func GetClusterPublicHostname(isOpenShift4 bool) (hostname string, err error)
- func GetDeploymentEnv(deployment *appsv1.Deployment, key string) (value string)
- func GetDeploymentEnvVarSource(deployment *appsv1.Deployment, key string) (valueFrom *corev1.EnvVarSource)
- func GetEnvByRegExp(regExp string) []corev1.EnvVar
- func GetK8Client() *k8s
- func GetMapValue(value map[string]string, defaultValue map[string]string) map[string]string
- func GetResourceQuantity(value string, defaultValue string) resource.Quantity
- func GetServerExposureStrategy(c *orgv1.CheCluster, defaultValue string) string
- func GetServerResources() ([]*v1.APIResourceList, error)
- func GetValue(key string, defaultValue string) (value string)
- func GetWorkspaceNamespaceDefault(cr *orgv1.CheCluster) string
- func IsDeleteOAuthInitialUser(cr *orgv1.CheCluster) bool
- func IsInitialOpenShiftOAuthUserEnabled(c *orgv1.CheCluster) bool
- func IsOAuthEnabled(c *orgv1.CheCluster) bool
- func IsTestMode() (isTesting bool)
- func IsWorkspaceInSameNamespaceWithChe(cr *orgv1.CheCluster) bool
- func MapToKeyValuePairs(m map[string]string) string
- func MergeMaps(first map[string]string, second map[string]string) map[string]string
- func NewBoolPointer(value bool) *bool
- func ReadObject(yamlFile string, obj interface{}) error
- func ValidateContainData(actualData map[string]string, expectedData map[string]string, t *testing.T)
- func ValidateSecurityContext(actualDeployment *appsv1.Deployment, t *testing.T)
- type Process
- type Runnable
- type TestExpectedResources
Constants ¶
This section is empty.
Variables ¶
var (
IsOpenShift, IsOpenShift4, _ = DetectOpenShift()
)
var (
K8sclient = GetK8Client()
)
Functions ¶
func CompareResources ¶
func CompareResources(actualDeployment *appsv1.Deployment, expected TestExpectedResources, t *testing.T)
func ContainsString ¶
func DetectOpenShift ¶
func DoRemoveString ¶
func FindVolumeMount ¶
func FindVolumeMount(volumes []corev1.VolumeMount, name string) corev1.VolumeMount
func GeneratePasswd ¶
func GetArchitectureDependentEnv ¶
GetArchitectureDependentEnv returns environment variable dependending on architecture by adding "_<ARCHITECTURE>" suffix. If variable is not set then the default will be return.
func GetDeploymentEnv ¶
func GetDeploymentEnv(deployment *appsv1.Deployment, key string) (value string)
func GetDeploymentEnvVarSource ¶
func GetDeploymentEnvVarSource(deployment *appsv1.Deployment, key string) (valueFrom *corev1.EnvVarSource)
func GetEnvByRegExp ¶
func GetK8Client ¶
func GetK8Client() *k8s
func GetMapValue ¶
func GetResourceQuantity ¶
func GetServerExposureStrategy ¶
func GetServerExposureStrategy(c *orgv1.CheCluster, defaultValue string) string
func GetServerResources ¶
func GetServerResources() ([]*v1.APIResourceList, error)
func GetWorkspaceNamespaceDefault ¶
func GetWorkspaceNamespaceDefault(cr *orgv1.CheCluster) string
GetWorkspaceNamespaceDefault - returns workspace namespace default strategy, which points on the namespaces used for workspaces execution.
func IsDeleteOAuthInitialUser ¶
func IsDeleteOAuthInitialUser(cr *orgv1.CheCluster) bool
IsDeleteOAuthInitialUser - returns true when initial Openshfit oAuth user must be deleted.
func IsInitialOpenShiftOAuthUserEnabled ¶
func IsInitialOpenShiftOAuthUserEnabled(c *orgv1.CheCluster) bool
IsInitialOpenShiftOAuthUserEnabled returns true when initial Openshift oAuth user is enabled for CheCluster resource, otherwise false.
func IsOAuthEnabled ¶
func IsOAuthEnabled(c *orgv1.CheCluster) bool
IsOAuthEnabled returns true when oAuth is enable for CheCluster resource, otherwise false.
func IsTestMode ¶
func IsTestMode() (isTesting bool)
func IsWorkspaceInSameNamespaceWithChe ¶
func IsWorkspaceInSameNamespaceWithChe(cr *orgv1.CheCluster) bool
IsWorkspaceInSameNamespaceWithChe return true when Che workspaces will be executed in the same namespace with Che, otherwise returns false.
func MapToKeyValuePairs ¶
func NewBoolPointer ¶
NewBoolPointer returns `bool` pointer to value in the memory. Unfortunately golang hasn't got syntax to create `bool` pointer.
func ReadObject ¶
func ValidateContainData ¶
func ValidateSecurityContext ¶
func ValidateSecurityContext(actualDeployment *appsv1.Deployment, t *testing.T)