From a41009effb3880d49ce961126db8353182344898 Mon Sep 17 00:00:00 2001 From: zc Date: Sun, 7 Jan 2024 07:07:07 +0800 Subject: [PATCH] support box relate all secrets --- core/handler/client/handle.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/handler/client/handle.go b/core/handler/client/handle.go index bac9987..b91b3a6 100644 --- a/core/handler/client/handle.go +++ b/core/handler/client/handle.go @@ -185,8 +185,11 @@ func handleInfo() http.HandlerFunc { secretNames.Add(v.Name) } var secretList []storageV1.Secret - secretS := &storageV1.Secret{Namespace: box.GetNamespace()} - if err := db.Where(secretS).Where("name in (?)", secretNames.List()).Find(&secretList).Error; err != nil { + secretDB := db.Where(&storageV1.Secret{Namespace: box.GetNamespace()}) + if !secretNames.Has("") { + secretDB = secretDB.Where("name in (?)", secretNames.List()) + } + if err := secretDB.Find(&secretList).Error; err != nil { wrapper.InternalError(w, err) return }