Skip to content

Commit

Permalink
chore: adds warning log if containers are empty using user filter (#3669
Browse files Browse the repository at this point in the history
)
  • Loading branch information
amir20 authored Feb 24, 2025
1 parent 15e410a commit c1038c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/container/container_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ func (s *ContainerStore) ListContainers(labels ContainerLabels) ([]Container, er
return nil, err
}

if len(validContainers) == 0 {
log.Warn().Interface("userLabels", labels).Msg("no containers found with user labels")
}

validIDMap := lo.KeyBy(validContainers, func(item Container) string {
return item.ID
})
Expand Down
2 changes: 1 addition & 1 deletion internal/docker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewClient(cli DockerCLI, host container.Host) *DockerClient {
}
}

// NewClientWithFilters creates a new instance of Client with docker filters
// NewLocalClient creates a new instance of Client with docker filters
func NewLocalClient(hostname string) (*DockerClient, error) {
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation(), client.WithUserAgent("Docker-Client/Dozzle"))

Expand Down

0 comments on commit c1038c0

Please sign in to comment.