HostNetworkHost -> HostNetworkingHost

Signed-off-by: Levi Harrison <git@leviharrison.dev>
This commit is contained in:
Levi Harrison 2021-08-03 05:58:49 -06:00
parent 3556302c76
commit c1b1b826ce
3 changed files with 23 additions and 23 deletions

View file

@ -735,12 +735,12 @@ var expectedConf = &Config{
ServiceDiscoveryConfigs: discovery.Configs{
&moby.DockerSDConfig{
Filters: []moby.Filter{},
Host: "unix:///var/run/docker.sock",
Port: 80,
HostNetworkHost: "localhost",
RefreshInterval: model.Duration(60 * time.Second),
HTTPClientConfig: config.DefaultHTTPClientConfig,
Filters: []moby.Filter{},
Host: "unix:///var/run/docker.sock",
Port: 80,
HostNetworkingHost: "localhost",
RefreshInterval: model.Duration(60 * time.Second),
HTTPClientConfig: config.DefaultHTTPClientConfig,
},
},
},

View file

@ -51,11 +51,11 @@ const (
// DefaultDockerSDConfig is the default Docker SD configuration.
var DefaultDockerSDConfig = DockerSDConfig{
RefreshInterval: model.Duration(60 * time.Second),
Port: 80,
Filters: []Filter{},
HostNetworkHost: "localhost",
HTTPClientConfig: config.DefaultHTTPClientConfig,
RefreshInterval: model.Duration(60 * time.Second),
Port: 80,
Filters: []Filter{},
HostNetworkingHost: "localhost",
HTTPClientConfig: config.DefaultHTTPClientConfig,
}
func init() {
@ -66,10 +66,10 @@ func init() {
type DockerSDConfig struct {
HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`
Host string `yaml:"host"`
Port int `yaml:"port"`
Filters []Filter `yaml:"filters"`
HostNetworkHost string `yaml:"host_network_host"`
Host string `yaml:"host"`
Port int `yaml:"port"`
Filters []Filter `yaml:"filters"`
HostNetworkingHost string `yaml:"host_networking_host"`
RefreshInterval model.Duration `yaml:"refresh_interval"`
}
@ -106,10 +106,10 @@ func (c *DockerSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type DockerDiscovery struct {
*refresh.Discovery
client *client.Client
port int
hostNetworkHost string
filters filters.Args
client *client.Client
port int
hostNetworkingHost string
filters filters.Args
}
// NewDockerDiscovery returns a new DockerDiscovery which periodically refreshes its targets.
@ -117,8 +117,8 @@ func NewDockerDiscovery(conf *DockerSDConfig, logger log.Logger) (*DockerDiscove
var err error
d := &DockerDiscovery{
port: conf.Port,
hostNetworkHost: conf.HostNetworkHost,
port: conf.Port,
hostNetworkingHost: conf.HostNetworkingHost,
}
hostURL, err := url.Parse(conf.Host)
@ -255,7 +255,7 @@ func (d *DockerDiscovery) refresh(ctx context.Context) ([]*targetgroup.Group, er
if c.HostConfig.NetworkMode != "host" {
addr = net.JoinHostPort(n.IPAddress, strconv.FormatUint(uint64(d.port), 10))
} else {
addr = d.hostNetworkHost
addr = d.hostNetworkingHost
}
labels[model.AddressLabel] = model.LabelValue(addr)

View file

@ -640,7 +640,7 @@ tls_config:
[ port: <int> | default = 80 ]
# The host to use if the container is in host networking mode.
[ host_network_host: <string> | default = "localhost" ]
[ host_networking_host: <string> | default = "localhost" ]
# Optional filters to limit the discovery process to a subset of available
# resources.