From bf87c4b1e427a9598417676e23c1234aa868f810 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 1 Jun 2021 12:23:13 -0700 Subject: [PATCH] fix: no need to proxy if IAM not initialized (#12416) IAM not initialized doesn't mean we can't still read the content from the disk, we should just allow the request to go-through if object layer is initialized. --- cmd/generic-handlers.go | 5 +---- cmd/metacache-manager.go | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index 64edef0ce..fae7ae4b6 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -166,10 +166,7 @@ func setBrowserRedirectHandler(h http.Handler) http.Handler { } func shouldProxy() bool { - if newObjectLayerFn() == nil { - return true - } - return !globalIAMSys.Initialized() + return newObjectLayerFn() == nil } // Fetch redirect location if urlPath satisfies certain diff --git a/cmd/metacache-manager.go b/cmd/metacache-manager.go index 3b53ee3f6..9ed167c4d 100644 --- a/cmd/metacache-manager.go +++ b/cmd/metacache-manager.go @@ -60,8 +60,8 @@ func (m *metacacheManager) initManager() { time.Sleep(time.Second) objAPI = newObjectLayerFn() } + if !globalIsErasure { - logger.Info("metacacheManager was initialized in non-erasure mode, skipping save") return }