Reload nginx when L4 proxy protocol change
Signed-off-by: JacieChao <kathyyy@163.com>
This commit is contained in:
parent
e659bb2963
commit
615485affb
2 changed files with 21 additions and 0 deletions
|
@ -524,6 +524,9 @@ func (l4b1 *L4Backend) Equal(l4b2 *L4Backend) bool {
|
|||
if l4b1.Protocol != l4b2.Protocol {
|
||||
return false
|
||||
}
|
||||
if l4b1.ProxyProtocol != l4b2.ProxyProtocol {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -94,6 +94,24 @@ func TestL4ServiceElementsMatch(t *testing.T) {
|
|||
{Port: 80, Endpoints: []Endpoint{{Address: "1.1.1.2"}, {Address: "1.1.1.1"}}}},
|
||||
true,
|
||||
},
|
||||
{
|
||||
[]L4Service{
|
||||
{Port: 80, Backend: L4Backend{Name: "test", Namespace: "default", Protocol: "TCP", ProxyProtocol: ProxyProtocol{Decode: false, Encode: false}}},
|
||||
},
|
||||
[]L4Service{
|
||||
{Port: 80, Backend: L4Backend{Name: "test", Namespace: "default", Protocol: "TCP", ProxyProtocol: ProxyProtocol{Decode: false, Encode: false}}},
|
||||
},
|
||||
true,
|
||||
},
|
||||
{
|
||||
[]L4Service{
|
||||
{Port: 80, Backend: L4Backend{Name: "test", Namespace: "default", Protocol: "TCP", ProxyProtocol: ProxyProtocol{Decode: false, Encode: false}}},
|
||||
},
|
||||
[]L4Service{
|
||||
{Port: 80, Backend: L4Backend{Name: "test", Namespace: "default", Protocol: "TCP", ProxyProtocol: ProxyProtocol{Decode: false, Encode: true}}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
|
Loading…
Reference in a new issue