infra

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PublisherService = `` /* 565-byte string literal not displayed */

PublisherService contains fixed response to be changed by tests.

Variables

View Source
var RunsOnOpenshift = func() bool {
	cmdGetDefaultServices := shell.Execute("kubectl get services -o=custom-columns='SERVICES:metadata.name' --no-headers -n default")
	<-cmdGetDefaultServices.Done()
	defaultServices := strings.Join(cmdGetDefaultServices.Status().Stdout, "")

	return strings.Contains(defaultServices, "openshift")
}()

Functions

func AllDeploymentConfigsAndPodsReady added in v0.0.4

func AllDeploymentConfigsAndPodsReady(ns string) func() bool

AllDeploymentConfigsAndPodsReady checks if both AllDeploymentsReady(DeploymentConfig) and AllPodsReady return true.

func AllDeploymentsAndPodsReady added in v0.0.4

func AllDeploymentsAndPodsReady(ns string) func() bool

AllDeploymentsAndPodsReady checks if both AllDeploymentsReady(Deployment) and AllPodsReady return true.

func AllDeploymentsReady added in v0.0.4

func AllDeploymentsReady(deploymentType, ns string) func() bool

AllDeploymentsReady checks whether all the deploymentType(deployment or deploymentconfig) in the given namespace have the same replicas and readyReplicas count.

func AllPodsReady added in v0.0.2

func AllPodsReady(ns string) func() bool

AllPodsReady checks whether all the pods (and their containers) in the given namespace are in Ready state.

func BuildOperator

func BuildOperator() (registry string)

BuildOperator builds istio-workspace operator and pushes it to specified registry.

func BuildTestService

func BuildTestService() (registry string)

BuildTestService builds istio-workspace-test service and pushes it to specified registry.

func BuildTestServicePreparedImage added in v0.0.2

func BuildTestServicePreparedImage(callerName string) (registry string)

BuildTestServicePreparedImage builds istio-workspace-test-prepared service and pushes it to specified registry.

func CleanupTestScenario added in v0.0.2

func CleanupTestScenario(namespace string)

func CreateFile

func CreateFile(filePath, content string)

CreateFile creates file under defined path with a given content.

func DeleteFile added in v0.0.2

func DeleteFile(filePath string)

DeleteFile deletes file under defined path.

func DeleteProjectCmd added in v0.0.2

func DeleteProjectCmd(name string) string

func DeployHelloWorldCmd added in v0.0.2

func DeployHelloWorldCmd(name, ns string) []string

func DeployTestScenario

func DeployTestScenario(scenario, namespace string)

DeployTestScenario deploys a test scenario into the specified namespace.

func DumpTelepresenceLog added in v0.0.2

func DumpTelepresenceLog(dir string)

DumpTelepresenceLog dumps telepresence log if exists.

func EnablePullingImages added in v0.0.4

func EnablePullingImages(namespace string)

func GenerateSessionName added in v0.0.4

func GenerateSessionName() string

GenerateSessionName returns a random safe string to be used as a session name.

func GetAllPods added in v0.0.2

func GetAllPods(ns string) []string

GetAllPods returns names of all pods from a given namespace.

func GetClusterHost added in v0.0.2

func GetClusterHost() string

func GetDevRepositoryName added in v0.0.5

func GetDevRepositoryName() string

GetDevRepositoryName returns the name of the repository containing development related images.

func GetDockerRegistryInternal added in v0.0.2

func GetDockerRegistryInternal() string

GetDockerRegistryInternal returns the internal address for the docker registry.

func GetEvents added in v0.0.2

func GetEvents(ns string)

GetEvents returns all events which occurred for a given namespace.

func GetGatewayHost added in v0.0.2

func GetGatewayHost(namespace string) string

GetGatewayHost returns the host the Gateway in the scenario is bound to (http header Host).

func GetImageTag added in v0.0.4

func GetImageTag() string

GetImageTag returns image tag if defined in IKE_IMAGE_TAG variable or "latest" otherwise.

func GetIstioIngressHostname added in v0.0.2

func GetIstioIngressHostname() string

func GetIstioNamespace added in v0.0.2

func GetIstioNamespace() string

func GetProjectLabels added in v0.0.2

func GetProjectLabels(namespace string) string

GetProjectLabels returns labels for a given namespace as a string.

func GetRepositoryName added in v0.0.4

func GetRepositoryName() string

GetRepositoryName returns the name of the repository.

func GetResourceCount added in v0.2.0

func GetResourceCount(resource, ns string) int

GetResourceCount returns the number of "resource"s in the given namespace.

func GetResourceCountFunc added in v0.2.0

func GetResourceCountFunc(resource, ns string) func() int

GetResourceCountFunc wraps GetResourceCount for to be called repeatedly.

func InstallLocalOperator added in v0.0.2

func InstallLocalOperator(namespace string)

func LoginAsTestPowerUser added in v0.0.2

func LoginAsTestPowerUser()

func MatchResourceCount added in v0.2.0

func MatchResourceCount(count int, getCount func() int) func() bool

MatchResourceCount eventually matcher matching count of resources.

func NewProjectCmd added in v0.0.2

func NewProjectCmd(name string) string

func PrepareEnv added in v0.0.4

func PrepareEnv(namespace string)

PrepareEnv sets up a environmental specific things.

func SetDockerRegistryExternal added in v0.0.4

func SetDockerRegistryExternal() string

func SetDockerRegistryInternal added in v0.0.4

func SetDockerRegistryInternal()

func TaskIsDone added in v0.0.9

func TaskIsDone(ns, taskName string) func() bool

TaskIsDone checks if given task has succeeded.

func TaskResult added in v0.0.9

func TaskResult(ns, taskName, key string) string

TaskResult returns value of given result variable for defined Task.

func UpdateSecurityConstraintsFor

func UpdateSecurityConstraintsFor(namespace string)

UpdateSecurityConstraintsFor applies anyuid and privileged constraints to a given namespace.

func UsePrebuiltImages added in v0.0.4

func UsePrebuiltImages() bool

UsePrebuiltImages returns true if test suite should use images that are built outside of the test execution flow.

Types

This section is empty.

Jump to

Keyboard shortcuts

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