-
Notifications
You must be signed in to change notification settings - Fork 80
refactor: include scheme in base URL for metrics #1243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e987764
33a830a
71680ad
165f7df
7868358
8bf33ec
f0e1220
54b8935
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,12 +207,12 @@ func WaitForDeployments(t *testing.T) wait.Awaitilities { | |
| // setup host metrics route for metrics verification in tests | ||
| hostMetricsRoute, err := initHostAwait.SetupRouteForService(t, "host-operator-metrics-service", "/metrics") | ||
| require.NoError(t, err) | ||
| initHostAwait.MetricsURL = hostMetricsRoute.Status.Ingress[0].Host | ||
| initHostAwait.MetricsURL = "https://" + hostMetricsRoute.Status.Ingress[0].Host | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded "https://" scheme contradicts the PR objective. The PR aims to "include the URL scheme (rather than assuming 'https') when constructing the base URL for metrics, allowing testing against an 'http' endpoint." However, these lines still hardcode "https://" for the metrics URLs. Follow the pattern established for the registration service URL (lines 100-104), which conditionally checks 🔎 Proposed fix to determine scheme based on TLS configurationFor line 210: - initHostAwait.MetricsURL = "https://" + hostMetricsRoute.Status.Ingress[0].Host
+ hostMetricsURL := "http://" + hostMetricsRoute.Status.Ingress[0].Host
+ if hostMetricsRoute.Spec.TLS != nil {
+ hostMetricsURL = "https://" + hostMetricsRoute.Status.Ingress[0].Host
+ }
+ initHostAwait.MetricsURL = hostMetricsURLFor line 215: - initMemberAwait.MetricsURL = "https://" + memberMetricsRoute.Status.Ingress[0].Host
+ memberMetricsURL := "http://" + memberMetricsRoute.Status.Ingress[0].Host
+ if memberMetricsRoute.Spec.TLS != nil {
+ memberMetricsURL = "https://" + memberMetricsRoute.Status.Ingress[0].Host
+ }
+ initMemberAwait.MetricsURL = memberMetricsURLAlso applies to: 215-215 🤖 Prompt for AI Agents
fbm3307 marked this conversation as resolved.
|
||
|
|
||
| // setup member metrics route for metrics verification in tests | ||
| memberMetricsRoute, err := initMemberAwait.SetupRouteForService(t, "member-operator-metrics-service", "/metrics") | ||
| require.NoError(t, err, "failed while setting up or waiting for the route to the 'member-operator-metrics' service to be available") | ||
| initMemberAwait.MetricsURL = memberMetricsRoute.Status.Ingress[0].Host | ||
| initMemberAwait.MetricsURL = "https://" + memberMetricsRoute.Status.Ingress[0].Host | ||
|
|
||
| // Wait for the webhooks in Member 1 only because we do not deploy webhooks for Member 2 | ||
| // (we can't deploy the same webhook multiple times on the same cluster) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
GO-2025-4155 crypto/x509 vulnerability💡 Result:
Summary: GO-2025-4155 (CVE-2025-61729) is a crypto/x509 vulnerability where HostnameError.Error() builds an unbounded, repeatedly-concatenated host list when constructing its error string. A maliciously-crafted certificate can cause excessive CPU/memory (quadratic) usage during hostname verification (Certificate.Verify / VerifyHostname). Fixes released in go1.24.11 and go1.25.5 — upgrade to those or later. [1][2][3]
Sources:
🌐 Web query:
GO-2025-4175 crypto/x509 vulnerability golang💡 Result:
Summary — GO-2025-4175 (CVE-2025-61727)
Sources:
[1] Go vuln DB: GO-2025-4175 / CVE-2025-61727 (pkg.go.dev).
[2] OSV / OSV JSON entry for GO-2025-4175.
[3] Release/security notes referencing go1.25.5 (SUSE advisory).
Confirm remediation plan exists for crypto/x509 vulnerabilities before silence-until deadline.
Both vulnerabilities are documented in the official Go vulnerability database:
Since these affect certificate validation (critical security component), ensure:
🤖 Prompt for AI Agents