fix: do not crash when docker is not connected

This commit is contained in:
Stavros
2025-02-02 19:34:02 +02:00
parent b3aac26644
commit fe594d2755
3 changed files with 32 additions and 17 deletions

View File

@@ -97,6 +97,13 @@ func (auth *Auth) UserAuthConfigured() bool {
}
func (auth *Auth) ResourceAllowed(context types.UserContext, host string) (bool, error) {
isConnected := auth.Docker.DockerConnected()
if !isConnected {
log.Debug().Msg("Docker not connected, allowing access")
return true, nil
}
appId := strings.Split(host, ".")[0]
containers, containersErr := auth.Docker.GetContainers()