Merge pull request #3765 from ElvinEfendi/custom-http-error-bug-fix

simplify customhttperrors e2e test and add regression test and fix a bug
This commit is contained in:
Kubernetes Prow Robot 2019-02-14 06:51:33 -08:00 committed by GitHub
commit b72dfa99d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 60 deletions

View file

@ -449,6 +449,22 @@ func (l1 *Location) Equal(l2 *Location) bool {
return false
}
if len(l1.CustomHTTPErrors) != len(l2.CustomHTTPErrors) {
return false
}
for _, code1 := range l1.CustomHTTPErrors {
found := false
for _, code2 := range l2.CustomHTTPErrors {
if code1 == code2 {
found = true
break
}
}
if !found {
return false
}
}
if !(&l1.ModSecurity).Equal(&l2.ModSecurity) {
return false
}