Documentation
¶
Overview ¶
Package runner provides a wrapper for the OpenShift extended test suite image.
Index ¶
Constants ¶
const (
// GitImage is the Docker image used to invoke Git.
GitImage = "docker.io/alpine/git@sha256:8f5659025d83a60e9d140123bb1b27f3c334578aef10d002da4e5848580f1a6c"
)
Variables ¶
var DefaultContainer = kubev1.Container{ Env: []kubev1.EnvVar{ { Name: "KUBECONFIG", Value: "~/.kube/config", }, }, Ports: []kubev1.ContainerPort{ { Name: resultsPortName, ContainerPort: resultsPort, Protocol: kubev1.ProtocolTCP, }, }, ImagePullPolicy: kubev1.PullAlways, ReadinessProbe: &kubev1.Probe{ Handler: kubev1.Handler{ HTTPGet: &kubev1.HTTPGetAction{ Path: "/", Port: intstr.FromInt(resultsPort), }, }, PeriodSeconds: 7, }, }
DefaultContainer is used by the DefaultRunner to run workloads
var DefaultRunner = &Runner{ Name: defaultName, ImageStreamName: testImageStreamName, ImageStreamNamespace: testImageStreamNamespace, PodSpec: kubev1.PodSpec{ Containers: []kubev1.Container{ DefaultContainer, }, RestartPolicy: kubev1.RestartPolicyNever, }, OutputDir: "./results", AuthConfig: AuthConfig{ Name: "osde2e", Server: "https://kubernetes.default", CA: serviceAccountDir + "/ca.crt", TokenFile: serviceAccountDir + "/token", }, Logger: log.New(os.Stderr, "", log.LstdFlags), }
DefaultRunner is a runner with the most commonly desired settings.
var (
ErrNotRun = errors.New("suite has not run yet")
)
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
AuthConfig defines how the test Pod connects to the cluster.
type GitRepo ¶
type GitRepo struct { // Name is used to identify the cloned repository. Name string // URL where the repository to be cloned is located. URL string // MountPath is the path where the cloned repository should be mounted. MountPath string }
GitRepo specifies a repository to be cloned and how it should be unpacked.
func (GitRepo) Container ¶
Container configured to clone the specified repository. Typically used as an init container.
func (GitRepo) VolumeMount ¶
func (r GitRepo) VolumeMount() kubev1.VolumeMount
VolumeMount configured to mount the cloned repository in the primary container.
type Repos ¶
type Repos []GitRepo
Repos can modify a Pod to clone each contained GitRepo.
func (Repos) ConfigurePod ¶
ConfigurePod modifies the given Pod to clone the Repo and make it available to any containers.
type Runner ¶
type Runner struct { // Kube client used to run test in-cluster. Kube kube.Interface // Image client used to gather ImageStream information. Image image.Interface // Name of the operation being performed. Name string // Namespace runner resources should be created in. Namespace string // ImageStreamName is the name of the ImageStream containing the suite. ImageStreamName string // ImageStreamNamespace is the namespace of the ImageStream containing the suite. ImageStreamNamespace string // ImageName is a container image used for the runner. ImageName string // Cmd is run within the test pod. If PodSpec is also set it overrides the container of the same name. Cmd string // PodSpec defines the Pod used by the runner. PodSpec kubev1.PodSpec // OutputDir is the directory that is copied from the Pod to the local host. OutputDir string // Tarball will create a single .tgz file for the entire OutputDir. Tarball bool // Repos are cloned and mounted into the test Pod. Repos // Auth defines how to connect to a cluster. AuthConfig // Logger receives all messages. *log.Logger // contains filtered or unexported fields }
Runner runs the OpenShift extended test suite within a cluster.
func (*Runner) RetrieveResults ¶
RetrieveResults gathers the results from the test Pod. Should only be called after tests are finished.