added explicit only mode for docker provider, updated dependencies

This commit is contained in:
yusing
2024-09-29 11:24:41 +08:00
parent e2b08d8667
commit 415f169f48
11 changed files with 43 additions and 25 deletions

View File

@@ -16,6 +16,7 @@ type Container struct {
func FromDocker(c *types.Container, dockerHost string) (res Container) {
res.Container = c
isExplicit := c.Labels[LabelAliases] != ""
res.ProxyProperties = &ProxyProperties{
DockerHost: dockerHost,
ContainerName: res.getName(),
@@ -25,6 +26,7 @@ func FromDocker(c *types.Container, dockerHost string) (res Container) {
NetworkMode: c.HostConfig.NetworkMode,
Aliases: res.getAliases(),
IsExcluded: U.ParseBool(res.getDeleteLabel(LabelExclude)),
IsExplicit: isExplicit,
IdleTimeout: res.getDeleteLabel(LabelIdleTimeout),
WakeTimeout: res.getDeleteLabel(LabelWakeTimeout),
StopMethod: res.getDeleteLabel(LabelStopMethod),

View File

@@ -13,6 +13,7 @@ type ProxyProperties struct {
Aliases []string `yaml:"-" json:"aliases"`
IsExcluded bool `yaml:"-" json:"is_excluded"`
IsExplicit bool `yaml:"-" json:"is_explicit"`
IdleTimeout string `yaml:"-" json:"idle_timeout"`
WakeTimeout string `yaml:"-" json:"wake_timeout"`
StopMethod string `yaml:"-" json:"stop_method"`