docs/tests for multiple HTTP address config (#11760)
This commit is contained in:
parent
5d9a506bc0
commit
2806dc2bd7
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
agent/config: Allow binding the HTTP server to multiple addresses.
|
||||
```
|
|
@ -1373,9 +1373,15 @@ func TestParseMultipleIPTemplates(t *testing.T) {
|
|||
expectErr bool
|
||||
}{
|
||||
{
|
||||
name: "deduplicates same ip",
|
||||
tmpl: "127.0.0.1 127.0.0.1",
|
||||
expectedOut: []string{"127.0.0.1"},
|
||||
name: "deduplicates same ip and preserves order",
|
||||
tmpl: "127.0.0.1 10.0.0.1 127.0.0.1",
|
||||
expectedOut: []string{"127.0.0.1", "10.0.0.1"},
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "includes sockaddr expression",
|
||||
tmpl: "10.0.0.1 {{ GetAllInterfaces | include \"flags\" \"loopback\" | limit 1 | attr \"address\" }} 10.0.0.2",
|
||||
expectedOut: []string{"10.0.0.1", "127.0.0.1", "10.0.0.2"},
|
||||
expectErr: false,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ type TestAgent struct {
|
|||
Key string
|
||||
|
||||
// All HTTP servers started. Used to prevent server leaks and preserve
|
||||
// backwards compability.
|
||||
// backwards compatibility.
|
||||
Servers []*HTTPServer
|
||||
|
||||
// Server is a reference to the primary, started HTTP endpoint.
|
||||
|
|
|
@ -88,8 +88,9 @@ testing.
|
|||
see the [`ports`](#ports) field. The values support [go-sockaddr/template
|
||||
format][go-sockaddr/template].
|
||||
|
||||
- `http` - The address the HTTP server is bound to. This is the most common
|
||||
bind address to change.
|
||||
- `http` - The address the HTTP server is bound to. This is the most
|
||||
common bind address to change. The `http` field accepts multiple
|
||||
values, separated by spaces, to bind to multiple addresses.
|
||||
|
||||
- `rpc` - The address to bind the internal RPC interfaces to. Should be
|
||||
exposed only to other cluster members if possible.
|
||||
|
|
Loading…
Reference in New Issue