Skip to content

Commit

Permalink
[artemiscloud#266] use WATCH_NAMESPACE
Browse files Browse the repository at this point in the history
Replace the custom env variable OPERATOR_WATCH_NAMESPACE with
WATCH_NAMESPACE.
  • Loading branch information
lavocatt committed Apr 11, 2024
1 parent 1b01553 commit 522909c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion controllers/activemqartemis_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ func (r *ActiveMQArtemisReconcilerImpl) syncMessageMigration(customResource *bro

func isLocalOnly() bool {
oprNamespace := os.Getenv("OPERATOR_NAMESPACE")
watchNamespace := os.Getenv("OPERATOR_WATCH_NAMESPACE")
watchNamespace := os.Getenv("WATCH_NAMESPACE")
return oprNamespace == watchNamespace
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/activemqartemisscaledown_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = Describe("Scale down controller", func() {

// note: we force a non local scaledown cr to exercise creds generation
// hense only valid with DEPLOY_OPERATOR = false
// see suite_test.go: os.Setenv("OPERATOR_WATCH_NAMESPACE", "SomeValueToCauesEqualitytoFailInIsLocalSoDrainControllerSortsCreds")
// see suite_test.go: os.Setenv("WATCH_NAMESPACE", "SomeValueToCauesEqualitytoFailInIsLocalSoDrainControllerSortsCreds")
if os.Getenv("USE_EXISTING_CLUSTER") == "true" {

brokerName := NextSpecResourceName()
Expand Down
4 changes: 2 additions & 2 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ var _ = BeforeSuite(func() {

// force isLocalOnly=false check from artemis reconciler such that scale down controller will create
// role binding to service account for the drainer pod
os.Setenv("OPERATOR_WATCH_NAMESPACE", "SomeValueToCauesEqualitytoFailInIsLocalSoDrainControllerSortsCreds")
os.Setenv("WATCH_NAMESPACE", "SomeValueToCauesEqualitytoFailInIsLocalSoDrainControllerSortsCreds")

var err error
currentDir, err = os.Getwd()
Expand Down Expand Up @@ -761,7 +761,7 @@ var _ = AfterSuite(func() {
cleanUpTestProxy()
}

os.Unsetenv("OPERATOR_WATCH_NAMESPACE")
os.Unsetenv("WATCH_NAMESPACE")

if os.Getenv("DEPLOY_OPERATOR") == "true" {
err := uninstallOperator(true, defaultNamespace)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func main() {
if err := os.Setenv("OPERATOR_NAMESPACE", oprNamespace); err != nil {
setupLog.Error(err, "failed to set operator's namespace to env")
}
if err := os.Setenv("OPERATOR_WATCH_NAMESPACE", watchNamespace); err != nil {
if err := os.Setenv("WATCH_NAMESPACE", watchNamespace); err != nil {
setupLog.Error(err, "failed to set operator's watch namespace to env")
}

Expand Down

0 comments on commit 522909c

Please sign in to comment.