Skip to content

Commit 16ffc00

Browse files
ivanmatmatioktalz
authored andcommitted
MINOR: settings for deep comparison to consider nil and empty as the same.
Some comparison between nil and empty fields can lead to unnecessary reload because they're considered as different.
1 parent b27274b commit 16ffc00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929

3030
"k8s.io/apimachinery/pkg/watch"
3131

32+
"github.com/go-test/deep"
3233
"github.com/jessevdk/go-flags"
3334

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

85+
deep.NilMapsAreEmpty = true
86+
deep.NilSlicesAreEmpty = true
87+
8488
// Default annotations
8589
defaultBackendSvc := fmt.Sprint(osArgs.DefaultBackendService)
8690
defaultCertificate := fmt.Sprint(osArgs.DefaultCertificate)

0 commit comments

Comments
 (0)