From 1280f560eed960edc1c1f5d501e58f79151d15f6 Mon Sep 17 00:00:00 2001 From: jgoelen Date: Wed, 31 Jul 2024 11:07:28 +0200 Subject: [PATCH] Add equality check of CustomHeaders to a Location --- pkg/apis/ingress/types_equals.go | 4 ++++ test/manifests/configuration-a.json | 7 ++++++- test/manifests/configuration-b.json | 7 ++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pkg/apis/ingress/types_equals.go b/pkg/apis/ingress/types_equals.go index eeed9a06e..e8ef2af4d 100644 --- a/pkg/apis/ingress/types_equals.go +++ b/pkg/apis/ingress/types_equals.go @@ -470,6 +470,10 @@ func (l1 *Location) Equal(l2 *Location) bool { return false } + if !l1.CustomHeaders.Equal(&l2.CustomHeaders) { + return false + } + return true } diff --git a/test/manifests/configuration-a.json b/test/manifests/configuration-a.json index ba513c616..f9599d77c 100644 --- a/test/manifests/configuration-a.json +++ b/test/manifests/configuration-a.json @@ -302,7 +302,12 @@ "validationDepth": 0 }, "use-port-in-redirects": false, - "configuration-snippet": "" + "configuration-snippet": "", + "customHeaders": { + "headers": { + "Server": "HAL9000" + } + } }] }, { "hostname": "dev.mycompany.com", diff --git a/test/manifests/configuration-b.json b/test/manifests/configuration-b.json index 9e40785b4..d2e71bb29 100644 --- a/test/manifests/configuration-b.json +++ b/test/manifests/configuration-b.json @@ -302,7 +302,12 @@ "validationDepth": 0 }, "use-port-in-redirects": false, - "configuration-snippet": "" + "configuration-snippet": "", + "customHeaders": { + "headers": { + "Server": "HAL9000" + } + } }] }, { "hostname": "dev.mycompany.com",