Merge pull request #6417 from JacieChao/proxy-reload

Reload nginx when L4 proxy protocol change
This commit is contained in:
Kubernetes Prow Robot 2020-11-05 12:16:51 -08:00 committed by GitHub
commit bbd8073c89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -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
}

View file

@ -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 {