Skip to content

Commit

Permalink
support box relate all secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Jan 6, 2024
1 parent dd5a88e commit a41009e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/handler/client/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a41009e

Please sign in to comment.