Refactor equals
This commit is contained in:
parent
39ecab8d5a
commit
951f7d7c1b
9 changed files with 330 additions and 145 deletions
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
|||
package luarestywaf
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
extensions "k8s.io/api/extensions/v1beta1"
|
||||
|
|
@ -25,6 +24,7 @@ import (
|
|||
"k8s.io/ingress-nginx/internal/ingress/annotations/parser"
|
||||
"k8s.io/ingress-nginx/internal/ingress/errors"
|
||||
"k8s.io/ingress-nginx/internal/ingress/resolver"
|
||||
"k8s.io/ingress-nginx/internal/sets"
|
||||
)
|
||||
|
||||
var luaRestyWAFModes = map[string]bool{"ACTIVE": true, "INACTIVE": true, "SIMULATE": true}
|
||||
|
|
@ -54,9 +54,12 @@ func (e1 *Config) Equal(e2 *Config) bool {
|
|||
if e1.Debug != e2.Debug {
|
||||
return false
|
||||
}
|
||||
if !reflect.DeepEqual(e1.IgnoredRuleSets, e2.IgnoredRuleSets) {
|
||||
|
||||
match := sets.StringElementsMatch(e1.IgnoredRuleSets, e2.IgnoredRuleSets)
|
||||
if !match {
|
||||
return false
|
||||
}
|
||||
|
||||
if e1.ExtraRulesetString != e2.ExtraRulesetString {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue