File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ const (
58
58
defaultInterval = time .Millisecond * 250
59
59
)
60
60
61
+ // TestConfig groups various fields together for use in the test helpers
61
62
type TestConfig struct {
62
63
Context context.Context
63
64
KubeCli * kubernetes.Clientset
@@ -71,6 +72,7 @@ type TestConfig struct {
71
72
Interval time.Duration
72
73
}
73
74
75
+ // NewTestConfig creates a new TestConfig instance
74
76
func NewTestConfig (nsName string ) * TestConfig {
75
77
cfg := config .GetConfigOrDie ()
76
78
gomega .Expect (cfg ).NotTo (gomega .BeNil ())
@@ -92,6 +94,7 @@ func NewTestConfig(nsName string) *TestConfig {
92
94
}
93
95
}
94
96
97
+ // CreateCli creates the Kubernetes client used in the tests, invoked after the scheme has been setup.
95
98
func (testConfig * TestConfig ) CreateCli () {
96
99
var err error
97
100
testConfig .K8sClient , err = client .New (testConfig .RestConfig , client.Options {Scheme : testConfig .Scheme })
@@ -436,6 +439,7 @@ func CreateObjsFromYaml(testConfig *TestConfig, docs []string) []string {
436
439
return objNames
437
440
}
438
441
442
+ // DeleteObjects deletes set of Kubernetes objects in the form of kind/name
439
443
func DeleteObjects (testConfig * TestConfig , kindAndNames []string ) {
440
444
for _ , kindAndName := range kindAndNames {
441
445
split := strings .Split (kindAndName , "/" )
You can’t perform that action at this time.
0 commit comments