1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

feat: supports k8s cluster (#3599)

This commit is contained in:
Amir Raminfar
2025-02-10 09:29:39 -08:00
committed by GitHub
parent 209ce312d4
commit 13da2a4222
50 changed files with 1591 additions and 734 deletions

View File

@@ -15,15 +15,15 @@ func (h *handler) containerActions(w http.ResponseWriter, r *http.Request) {
action := chi.URLParam(r, "action")
id := chi.URLParam(r, "id")
usersFilter := h.config.Filter
userLabels := h.config.Labels
if h.config.Authorization.Provider != NONE {
user := auth.UserFromContext(r.Context())
if user.ContainerFilter.Exists() {
usersFilter = user.ContainerFilter
if user.ContainerLabels.Exists() {
userLabels = user.ContainerLabels
}
}
containerService, err := h.multiHostService.FindContainer(hostKey(r), id, usersFilter)
containerService, err := h.hostService.FindContainer(hostKey(r), id, userLabels)
if err != nil {
log.Error().Err(err).Msg("error while trying to find container")
http.Error(w, err.Error(), http.StatusNotFound)