Skip to content

Commit

Permalink
Add equality check of CustomHeaders to a Location
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoelen authored and Gacko committed Jan 9, 2025
1 parent 063c02f commit fb0ba08
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/apis/ingress/types_equals.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ func (l1 *Location) Equal(l2 *Location) bool {
return false
}

if !l1.CustomHeaders.Equal(&l2.CustomHeaders) {
return false
}

return true
}

Expand Down
7 changes: 6 additions & 1 deletion test/manifests/configuration-a.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
"configuration-snippet": "",
"customHeaders": {
"headers": {
"Server": "HAL9000"
}
}
}]
}, {
"hostname": "dev.mycompany.com",
Expand Down
7 changes: 6 additions & 1 deletion test/manifests/configuration-b.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
"configuration-snippet": "",
"customHeaders": {
"headers": {
"Server": "HAL9000"
}
}
}]
}, {
"hostname": "dev.mycompany.com",
Expand Down

0 comments on commit fb0ba08

Please sign in to comment.