Skip to content

Commit

Permalink
MINOR: settings for deep comparison to consider nil and empty as the …
Browse files Browse the repository at this point in the history
…same.

Some comparison between nil and empty fields can lead to unnecessary reload because they're considered as different.
  • Loading branch information
ivanmatmati authored and oktalz committed May 10, 2023
1 parent b27274b commit 16ffc00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

"k8s.io/apimachinery/pkg/watch"

"github.com/go-test/deep"
"github.com/jessevdk/go-flags"

"github.com/haproxytech/kubernetes-ingress/pkg/annotations"
Expand Down Expand Up @@ -81,6 +82,9 @@ func main() {
osArgs.ControllerPort = 6060
}

deep.NilMapsAreEmpty = true
deep.NilSlicesAreEmpty = true

// Default annotations
defaultBackendSvc := fmt.Sprint(osArgs.DefaultBackendService)
defaultCertificate := fmt.Sprint(osArgs.DefaultCertificate)
Expand Down

0 comments on commit 16ffc00

Please sign in to comment.