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 (
5858 defaultInterval = time .Millisecond * 250
5959)
6060
61+ // TestConfig groups various fields together for use in the test helpers
6162type TestConfig struct {
6263 Context context.Context
6364 KubeCli * kubernetes.Clientset
@@ -71,6 +72,7 @@ type TestConfig struct {
7172 Interval time.Duration
7273}
7374
75+ // NewTestConfig creates a new TestConfig instance
7476func NewTestConfig (nsName string ) * TestConfig {
7577 cfg := config .GetConfigOrDie ()
7678 gomega .Expect (cfg ).NotTo (gomega .BeNil ())
@@ -92,6 +94,7 @@ func NewTestConfig(nsName string) *TestConfig {
9294 }
9395}
9496
97+ // CreateCli creates the Kubernetes client used in the tests, invoked after the scheme has been setup.
9598func (testConfig * TestConfig ) CreateCli () {
9699 var err error
97100 testConfig .K8sClient , err = client .New (testConfig .RestConfig , client.Options {Scheme : testConfig .Scheme })
@@ -436,6 +439,7 @@ func CreateObjsFromYaml(testConfig *TestConfig, docs []string) []string {
436439 return objNames
437440}
438441
442+ // DeleteObjects deletes set of Kubernetes objects in the form of kind/name
439443func DeleteObjects (testConfig * TestConfig , kindAndNames []string ) {
440444 for _ , kindAndName := range kindAndNames {
441445 split := strings .Split (kindAndName , "/" )
You can’t perform that action at this time.
0 commit comments