Skip to content

Issue #451 Agent and Server examples cannot find the certificates when the CWD is different#454

Merged
tigrannajaryan merged 8 commits into
open-telemetry:mainfrom
juandemanjon:main
Oct 29, 2025
Merged

Issue #451 Agent and Server examples cannot find the certificates when the CWD is different#454
tigrannajaryan merged 8 commits into
open-telemetry:mainfrom
juandemanjon:main

Conversation

@juandemanjon

@juandemanjon juandemanjon commented Oct 2, 2025

Copy link
Copy Markdown
Contributor
  • Move internal/certs.go to internal/examples/certs.go
  • Refactor server/serverimpl_test.go, leveraging testcerts instead of the moved certs.go
  • Embed all cert files
  • Embed all html files
  • Replace the ReadFile(file) with its embedded cert as []byte

@juandemanjon
juandemanjon requested a review from a team as a code owner October 2, 2025 07:21
@codecov

codecov Bot commented Oct 2, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.84%. Comparing base (632b361) to head (3efca6a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #454      +/-   ##
==========================================
+ Coverage   78.23%   80.84%   +2.61%     
==========================================
  Files          28       27       -1     
  Lines        2825     2709     -116     
==========================================
- Hits         2210     2190      -20     
+ Misses        487      394      -93     
+ Partials      128      125       -3     

☔ 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.

@jackgopack4 jackgopack4 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these make sense to me, thanks for this work

@tigrannajaryan

Copy link
Copy Markdown
Member

I checked out your branch, run make run-examples and tried accessing http://localhost:4321/ and I get HTTP 500.

It works fine on the main branch, so something is off with the PR. I did not diagnose further.

@juandemanjon

Copy link
Copy Markdown
Contributor Author

I checked out your branch, run make run-examples and tried accessing http://localhost:4321/ and I get HTTP 500.

It works fine on the main branch, so something is off with the PR. I did not diagnose further.

I need to add the template to the embed files

opamp-go % internal/examples/server/bin/server 
2025/10/15 14:50:20.073424 [MAIN] OpAMP Server starting...
2025/10/15 14:50:20.073938 [MAIN] OpAMP Server running...
2025/10/15 14:50:32.021367 [UI] Error parsing html template root.html: open /Users/jmanjon/Projects/github/juandemanjon/opamp-go/uisrv/html/header.html: no such file or directory

@juandemanjon

Copy link
Copy Markdown
Contributor Author

@tigrannajaryan I fixed the issue with the html templates. Please, review the changes

Comment thread server/serverimpl_test.go
"../internal/certs/server_certs/server.cert.pem",
"../internal/certs/server_certs/server.key.pem",
)
ca := testcerts.NewCA()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tigrannajaryan
tigrannajaryan merged commit ad4ec01 into open-telemetry:main Oct 29, 2025
11 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.

3 participants