...
1 package helper
2
3 import (
4 . "github.com/onsi/ginkgo/v2"
5 batchv1 "k8s.io/api/batch/v1"
6 corev1 "k8s.io/api/core/v1"
7 )
8
9
10 type Component interface {
11
12 ExpectIsDeployed()
13
14 ExpectIsNotDeployed()
15
16
17
18
19 Exec(container string, args []string, expectedSuccess *bool) (string, string)
20
21 GetEnvVars(container string) map[string]string
22
23 GetLabels() map[string]string
24
25 GetAnnotations() map[string]string
26
27 GetPodDef() *corev1.Pod
28
29 GetJobDef() *batchv1.Job
30
31 GetPodLogs() string
32 }
33
34 func NewComponent(componentName string, app string, mode string, namespace string, cli CliRunner) Component {
35 if NeedsCluster(CurrentSpecReport().Labels()) {
36 return NewClusterComponent(componentName, app, mode, namespace, cli)
37 } else {
38 return NewPodmanComponent(componentName, app)
39 }
40 }
41
View as plain text