1
0
Fork 0

Allow discovering non-running Docker containers

This commit is contained in:
Alexis Couvreur 2025-10-24 08:08:04 -04:00 committed by GitHub
parent 5c489c05fc
commit 10be359327
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 600 additions and 11 deletions

View file

@ -16,17 +16,24 @@ const (
// configuration contains information from the labels that are globals (not related to the dynamic configuration)
// or specific to the provider.
type configuration struct {
Enable bool
Network string
LBSwarm bool
Enable bool
Network string
LBSwarm bool
AllowNonRunning bool
}
type labelConfiguration struct {
Enable bool
Docker *specificConfiguration
Docker *dockerSpecificConfiguration
Swarm *specificConfiguration
}
type dockerSpecificConfiguration struct {
Network *string
LBSwarm bool
AllowNonRunning bool
}
type specificConfiguration struct {
Network *string
LBSwarm bool
@ -43,9 +50,15 @@ func (p *Shared) extractDockerLabels(container dockerData) (configuration, error
network = *conf.Docker.Network
}
var allowNonRunning bool
if conf.Docker != nil {
allowNonRunning = conf.Docker.AllowNonRunning
}
return configuration{
Enable: conf.Enable,
Network: network,
Enable: conf.Enable,
Network: network,
AllowNonRunning: allowNonRunning,
}, nil
}