Skip to content

Commit

Permalink
test(integration): use the new kind options
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <[email protected]>
  • Loading branch information
fntlnz committed Apr 12, 2019
1 parent 321f94d commit 1ce49ae
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"gotest.tools/icmd"
"sigs.k8s.io/kind/pkg/cluster"
"sigs.k8s.io/kind/pkg/cluster/config/encoding"
"sigs.k8s.io/kind/pkg/cluster/create"
)

var (
KubectlTraceBinary = os.Getenv("TEST_KUBECTLTRACE_BINARY")
KindImageTag = os.Getenv("TEST_KIND_IMAGETAG")
)

type KubectlTraceSuite struct {
Expand All @@ -30,26 +30,20 @@ func init() {
KubectlTraceBinary = "kubectl-trace"
}

if KindImageTag == "" {
KindImageTag = "kindest/node:v1.12.3"
}
check.Suite(&KubectlTraceSuite{})
}

func (k *KubectlTraceSuite) SetUpSuite(c *check.C) {
cfg, err := encoding.Load("")
c.Assert(err, check.IsNil)
retain := false
wait := time.Duration(0)

err = cfg.Validate()
c.Assert(err, check.IsNil)

clusterName, err := generateClusterName()
c.Assert(err, check.IsNil)
kctx := cluster.NewContext(clusterName)

err = kctx.Create(cfg, retain, wait)
err = kctx.Create(cfg, create.Retain(false), create.WaitForReady(time.Duration(0)))
c.Assert(err, check.IsNil)
k.kindContext = kctx

Expand All @@ -65,8 +59,8 @@ func (k *KubectlTraceSuite) SetUpSuite(c *check.C) {
}
}

func (s *KubectlTraceSuite) TearDownSuite(c *check.C) {
err := s.kindContext.Delete()
func (k *KubectlTraceSuite) TearDownSuite(c *check.C) {
err := k.kindContext.Delete()
c.Assert(err, check.IsNil)
}

Expand Down

0 comments on commit 1ce49ae

Please sign in to comment.