Skip to content

Commit

Permalink
Update var names integration environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Manno authored and Mario Manno committed May 7, 2020
1 parent 5b91c29 commit c891c20
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions integration/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const (
func NewEnvironment(kubeConfig *rest.Config) *Environment {
atomic.AddInt32(&namespaceCounter, 1)
namespaceID := gomegaConfig.GinkgoConfig.ParallelNode*100 + int(namespaceCounter)
// the single namespace used by this test
ns := utils.GetNamespaceName(namespaceID)

return &Environment{
Expand All @@ -57,6 +58,7 @@ func NewEnvironment(kubeConfig *rest.Config) *Environment {
MeltdownDuration: defaultTestMeltdownDuration * time.Second,
MeltdownRequeueAfter: defaultTestMeltdownRequeueAfter * time.Second,
MonitoredID: ns,
OperatorNamespace: ns,
Fs: afero.NewOsFs(),
},
},
Expand Down
2 changes: 1 addition & 1 deletion integration/environment/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
func (e *Environment) SetupNamespace() error {
nsTeardown, err := e.CreateLabeledNamespace(e.Namespace,
map[string]string{
monitorednamespace.LabelNamespace: e.Namespace,
monitorednamespace.LabelNamespace: e.Config.MonitoredID,
qjv1a1.LabelServiceAccount: persistOutputServiceAccount,
})
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions integration/environment/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ func (e *Environment) setupCFOperator() (manager.Manager, error) {

e.Config.WebhookServerPort = port

e.Config.OperatorNamespace = e.Namespace
e.Config.MonitoredID = e.Namespace

dockerImageOrg, found := os.LookupEnv("DOCKER_IMAGE_ORG")
if !found {
dockerImageOrg = "cfcontainerization"
Expand Down
4 changes: 2 additions & 2 deletions integration/environment/quarks_job_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func (q *QuarksJobCmd) Build() error {
}

// Start starts the specified quarks-job in a namespace
func (q *QuarksJobCmd) Start(namespace string) error {
func (q *QuarksJobCmd) Start(id string) error {
cmd := exec.Command(q.Path,
"--monitored-id", namespace,
"-o", "cfcontainerization",
"-r", "quarks-job",
"--meltdown-duration", strconv.Itoa(defaultTestMeltdownDuration),
"--meltdown-requeue-after", strconv.Itoa(defaultTestMeltdownRequeueAfter),
"--monitored-id", id,
"-t", quarksJobTag(),
)
_, err := gexec.Start(cmd, ginkgo.GinkgoWriter, ginkgo.GinkgoWriter)
Expand Down
2 changes: 1 addition & 1 deletion integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var _ = BeforeEach(func() {
fmt.Printf("WARNING: failed to setup quarks-job operator service account: %s\n", err)
}

err = qjobCmd.Start(env.Namespace)
err = qjobCmd.Start(env.Config.MonitoredID)
if err != nil {
fmt.Printf("WARNING: failed to start quarks job operator: %v\n", err)
}
Expand Down

0 comments on commit c891c20

Please sign in to comment.