Skip to content

Commit 33b040d

Browse files
committed
Fix minor issues
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
1 parent 33e8a21 commit 33b040d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,6 @@ func main() {
187187
},
188188
}
189189

190-
if watchedNsCache := getDefaultWatchedNamespacesCacheOptions(); watchedNsCache != nil {
191-
options.Cache.DefaultNamespaces = watchedNsCache
192-
}
193-
194190
// Use transformers to strip data from Secrets and ConfigMaps
195191
// that are not tracked by the operator to reduce memory usage.
196192
if strings.ToLower(os.Getenv("DISABLE_MEMORY_OPTIMIZATION")) != "true" {
@@ -203,14 +199,18 @@ func main() {
203199
}
204200
}
205201

202+
if watchedNsCache := getDefaultWatchedNamespacesCacheOptions(); watchedNsCache != nil {
203+
options.Cache.DefaultNamespaces = watchedNsCache
204+
}
205+
206206
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), options)
207207
if err != nil {
208208
setupLog.Error(err, "unable to start manager")
209209
os.Exit(1)
210210
}
211211

212212
var client crclient.Client
213-
if strings.ToLower(os.Getenv("DISABLE_MEMORY_OPTIMIZATION")) == "true" {
213+
if strings.ToLower(os.Getenv("DISABLE_MEMORY_OPTIMIZATION")) != "true" {
214214
liveClient, err := crclient.New(ctrl.GetConfigOrDie(), crclient.Options{Scheme: mgr.GetScheme()})
215215
if err != nil {
216216
setupLog.Error(err, "unable to create live client")

0 commit comments

Comments
 (0)