Repository: kedacore/http-add-on
Pull request #1196 (2024-11-25 18:19:44)

chore(deps): bump github.com/onsi/gomega from 1.34.2 to 1.36.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.34.2 to 1.36.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/onsi/gomega/releases">github.com/onsi/gomega's releases</a>.</em></p>
<blockquote>
<h2>v1.36.0</h2>
<h2>1.36.0</h2>
<h3>Features</h3>
<ul>
<li>new: make collection-related matchers Go 1.23 iterator aware [4c964c6]</li>
</ul>
<h3>Maintenance</h3>
<ul>
<li>Replace min/max helpers with built-in min/max [ece6872]</li>
<li>Fix some typos in docs [8e924d7]</li>
</ul>
<h2>v1.35.1</h2>
<h2>1.35.1</h2>
<h3>Fixes</h3>
<ul>
<li>Export EnforceDefaultTimeoutsWhenUsingContexts and DisableDefaultTimeoutsWhenUsingContext [ca36da1]</li>
</ul>
<h2>v1.35.0</h2>
<h2>1.35.0</h2>
<h3>Features</h3>
<ul>
<li>You can now call <code>EnforceDefaultTimeoutsWhenUsingContexts()</code> to have <code>Eventually</code> honor the default timeout when passed a context.  (prior to this you had to expclility add a timeout) [e4c4265]</li>
<li>You can call <code>StopTrying(message).Successfully()</code> to abort a <code>Consistently</code> early without failure [eeca931]</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Stop memoizing the result of <code>HaveField</code> to avoid unexpected errors when used with async assertions. [3bdbc4e]</li>
</ul>
<h3>Maintenance</h3>
<ul>
<li>Bump all dependencies [a05a416]</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/onsi/gomega/blob/master/CHANGELOG.md">github.com/onsi/gomega's changelog</a>.</em></p>
<blockquote>
<h2>1.36.0</h2>
<h3>Features</h3>
<ul>
<li>new: make collection-related matchers Go 1.23 iterator aware [4c964c6]</li>
</ul>
<h3>Maintenance</h3>
<ul>
<li>Replace min/max helpers with built-in min/max [ece6872]</li>
<li>Fix some typos in docs [8e924d7]</li>
</ul>
<h2>1.35.1</h2>
<h3>Fixes</h3>
<ul>
<li>Export EnforceDefaultTimeoutsWhenUsingContexts and DisableDefaultTimeoutsWhenUsingContext [ca36da1]</li>
</ul>
<h2>1.35.0</h2>
<h3>Features</h3>
<ul>
<li>You can now call <code>EnforceDefaultTimeoutsWhenUsingContexts()</code> to have <code>Eventually</code> honor the default timeout when passed a context.  (prior to this you had to expclility add a timeout) [e4c4265]</li>
<li>You can call <code>StopTrying(message).Successfully()</code> to abort a <code>Consistently</code> early without failure [eeca931]</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Stop memoizing the result of <code>HaveField</code> to avoid unexpected errors when used with async assertions. [3bdbc4e]</li>
</ul>
<h3>Maintenance</h3>
<ul>
<li>Bump all dependencies [a05a416]</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/onsi/gomega/commit/f1ff459a1aa4fb0000c65d4051b09d669a09d346"><code>f1ff459</code></a> v1.36.0</li>
<li><a href="https://github.com/onsi/gomega/commit/4c964c6b4e8d0ccab972a25aff74ed28940979e5"><code>4c964c6</code></a> new: make collection-related matchers Go 1.23 iterator aware</li>
<li><a href="https://github.com/onsi/gomega/commit/ece687263025cc7b933e8d72fba9b458fea496e4"><code>ece6872</code></a> Replace min/max helpers with built-in min/max</li>
<li><a href="https://github.com/onsi/gomega/commit/8e924d781b775bb181e404dbc69a582875b0ac39"><code>8e924d7</code></a> Fix some typos in docs</li>
<li><a href="https://github.com/onsi/gomega/commit/9f5a208e8adf32c11daf594b3c98a513f13388dd"><code>9f5a208</code></a> v1.35.1</li>
<li><a href="https://github.com/onsi/gomega/commit/ca36da13f3000cac2fdf7bae45a03867715711a2"><code>ca36da1</code></a> Export EnforceDefaultTimeoutsWhenUsingContexts and DisableDefaultTimeoutsWhen...</li>
<li><a href="https://github.com/onsi/gomega/commit/d6331f9125b3edd1f8afeb169b145f54104b2dde"><code>d6331f9</code></a> v1.35.0</li>
<li><a href="https://github.com/onsi/gomega/commit/5deaf2330c9e7dc4d78155bc92c04b5adc4bcc5e"><code>5deaf23</code></a> fix tests, but like actually this time</li>
<li><a href="https://github.com/onsi/gomega/commit/eeca931c42d3e00f631b64d883b8c103b414105a"><code>eeca931</code></a> Add Successfully() to StopTrying() to signal that Consistently can end early ...</li>
<li><a href="https://github.com/onsi/gomega/commit/3bdbc4eef9a6fc310d82ffa5df7703ff934c9b1e"><code>3bdbc4e</code></a> stop memoizing result of HaveField</li>
<li>Additional commits viewable in <a href="https://github.com/onsi/gomega/compare/v1.34.2...v1.36.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/onsi/gomega&package-manager=go_modules&previous-version=1.34.2&new-version=1.36.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0659545..784230c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,8 @@ This changelog keeps track of work items that have been completed and are ready
 - **General**: Support setting multiple TLS certs for different domains on the interceptor proxy ([#1116](https://github.com/kedacore/http-add-on/issues/1116))
 - **General**: TODO ([#TODO](https://github.com/kedacore/http-add-on/issues/TODO))
 
+- **Interceptor**: Add support for for AWS ELB healthcheck probe ([#1198](https://github.com/kedacore/http-add-on/issues/1198))
+
 ### Improvements
 
 - **General**: TODO ([#TODO](https://github.com/kedacore/http-add-on/issues/TODO))
diff --git a/go.mod b/go.mod
index 709fcc9..3456ce3 100644
--- a/go.mod
+++ b/go.mod
@@ -9,7 +9,7 @@ require (
 	github.com/kedacore/keda/v2 v2.15.1
 	github.com/kelseyhightower/envconfig v1.4.0
 	github.com/onsi/ginkgo/v2 v2.20.2
-	github.com/onsi/gomega v1.34.2
+	github.com/onsi/gomega v1.36.0
 	github.com/stretchr/testify v1.9.0
 	go.opentelemetry.io/otel v1.31.0
 	go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.31.0
diff --git a/go.sum b/go.sum
index 95b6141..74ac2a4 100644
--- a/go.sum
+++ b/go.sum
@@ -112,8 +112,8 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J
 github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
 github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4=
 github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag=
-github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
-github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
+github.com/onsi/gomega v1.36.0 h1:Pb12RlruUtj4XUuPUqeEWc6j5DkVVVA49Uf6YLfC95Y=
+github.com/onsi/gomega v1.36.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
 github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
diff --git a/interceptor/middleware/routing.go b/interceptor/middleware/routing.go
index 69c6bcd..7f3ef81 100644
--- a/interceptor/middleware/routing.go
+++ b/interceptor/middleware/routing.go
@@ -17,6 +17,7 @@ import (
 var (
 	kubernetesProbeUserAgent = regexp.MustCompile(`(^|\s)kube-probe/`)
 	googleHCUserAgent        = regexp.MustCompile(`(^|\s)GoogleHC/`)
+	awsELBserAgent           = regexp.MustCompile(`(^|\s)ELB-HealthChecker/`)
 )
 
 type Routing struct {
@@ -112,5 +113,5 @@ func (rm *Routing) streamFromHTTPSO(ctx context.Context, httpso *httpv1alpha1.HT
 func (rm *Routing) isProbe(r *http.Request) bool {
 	ua := r.UserAgent()
 
-	return kubernetesProbeUserAgent.Match([]byte(ua)) || googleHCUserAgent.Match([]byte(ua))
+	return kubernetesProbeUserAgent.Match([]byte(ua)) || googleHCUserAgent.Match([]byte(ua)) || awsELBserAgent.Match([]byte(ua))
 }


Test patch:
diff --git a/interceptor/middleware/routing_test.go b/interceptor/middleware/routing_test.go
index b57f232..6f3ae4f 100644
--- a/interceptor/middleware/routing_test.go
+++ b/interceptor/middleware/routing_test.go
@@ -304,7 +304,19 @@ var _ = Describe("RoutingMiddleware", func() {
 			Expect(b).To(BeTrue())
 		})
 
-		It("returns false if the request is not from kube-probe or GoogleHC", func() {
+		It("returns true if the request is from AWS ELB", func() {
+			const (
+				uaVal = "Go-http-client/1.1 ELB-HealthChecker/2.0 (linux/amd64) kubernetes/4c94112"
+			)
+
+			r.Header.Set(uaKey, uaVal)
+
+			var rm Routing
+			b := rm.isProbe(r)
+			Expect(b).To(BeTrue())
+		})
+
+		It("returns false if the request is not from kube-probe or GoogleHC or ELB-HealthChecker", func() {
 			const (
 				uaVal = "Go-http-client/1.1 kubectl/v1.27.1 (linux/amd64) kubernetes/4c94112"
 			)