From c891c20f1a8e2c91572936b03cc706b3d3078484 Mon Sep 17 00:00:00 2001 From: Mario Manno Date: Thu, 7 May 2020 10:40:56 +0200 Subject: [PATCH] Update var names integration environment --- integration/environment/environment.go | 2 ++ integration/environment/namespace.go | 2 +- integration/environment/operator.go | 3 --- integration/environment/quarks_job_cmd.go | 4 ++-- integration/suite_test.go | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/integration/environment/environment.go b/integration/environment/environment.go index a4c98e7ea..268142f2d 100644 --- a/integration/environment/environment.go +++ b/integration/environment/environment.go @@ -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{ @@ -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(), }, }, diff --git a/integration/environment/namespace.go b/integration/environment/namespace.go index 4b69e99a0..1e5dee8a8 100644 --- a/integration/environment/namespace.go +++ b/integration/environment/namespace.go @@ -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 { diff --git a/integration/environment/operator.go b/integration/environment/operator.go index a33c852e6..4ee344cc8 100644 --- a/integration/environment/operator.go +++ b/integration/environment/operator.go @@ -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" diff --git a/integration/environment/quarks_job_cmd.go b/integration/environment/quarks_job_cmd.go index b8fcdca9d..ecb315351 100644 --- a/integration/environment/quarks_job_cmd.go +++ b/integration/environment/quarks_job_cmd.go @@ -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) diff --git a/integration/suite_test.go b/integration/suite_test.go index b0edd79d8..aac8332be 100644 --- a/integration/suite_test.go +++ b/integration/suite_test.go @@ -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) }