Skip to content

Conversation

TomerFi
Copy link
Contributor

@TomerFi TomerFi commented Sep 23, 2025

This PR resolves a bug where the telemetry ConfigMap was not found because the system was incorrectly looking for it in the toolhive-system Namespace. The current implementation assumes a fixed namespace, which is not always correct. This led to the following error:

{"level":"error","ts":1758653623.3299508,"caller":"telemetry/telemetry.go:231","msg":"Failed initial telemetry check","error":"failed to save telemetry data: namespaces \"toolhive-system\" not found","stacktrace":"github.com/stacklok/toolhive/pkg/operator/telemetry.(*Service).StartTelemetryWorker\n\tgithub.com/stacklok/toolhive/pkg/operator/telemetry/telemetry.go:231\ngithub.com/stacklok/toolhive/pkg/operator/telemetry.(*LeaderTelemetryRunnable).Start.func1\n\tgithub.com/stacklok/toolhive/pkg/operator/telemetry/telemetry.go:58"}

To test the suggested fix, I built and deployed an intermediate image in a namespace other than toolhive-system. The successful log records indicate that the system was able to find the ConfigMap and complete the update check:

{"level":"info","ts":1758654932.597325,"caller":"telemetry/telemetry.go:115","msg":"Checking for updates..."}
...
{"level":"info","ts":1758654932.7073739,"caller":"telemetry/telemetry.go:133","msg":"Update check completed","currentVersion":"build-ec51391a","latestVersion":"v0.3.5"}

@TomerFi TomerFi force-pushed the configure-telemetry-namespace branch from ec51391 to 94da230 Compare September 23, 2025 19:45
JAORMX
JAORMX previously approved these changes Sep 24, 2025
@JAORMX
Copy link
Collaborator

JAORMX commented Sep 24, 2025

@TomerFi seems the helm chart test is failing, you might wanna check that out. Also, you probably wanna rebase.

@TomerFi
Copy link
Contributor Author

TomerFi commented Sep 24, 2025

@JAORMX ^^

Copy link

codecov bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.54%. Comparing base (42c2d6f) to head (78b0e68).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cmd/thv-operator/main.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2003      +/-   ##
==========================================
+ Coverage   47.52%   47.54%   +0.02%     
==========================================
  Files         232      232              
  Lines       28890    28892       +2     
==========================================
+ Hits        13729    13736       +7     
+ Misses      14132    14129       -3     
+ Partials     1029     1027       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Tomer Figenblat <tfigenbl@redhat.com>
Signed-off-by: Tomer Figenblat <tfigenbl@redhat.com>
Signed-off-by: Tomer Figenblat <tfigenbl@redhat.com>
@TomerFi TomerFi force-pushed the configure-telemetry-namespace branch from 7d762ab to 78b0e68 Compare September 24, 2025 13:51
@TomerFi
Copy link
Contributor Author

TomerFi commented Sep 24, 2025

@JAORMX ^^

@JAORMX JAORMX merged commit 417c167 into stacklok:main Sep 25, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants