Skip to content
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

Report the version from the elastic agent package instead of agent binary #2582

Closed
2 tasks
joshdover opened this issue May 1, 2023 · 5 comments · Fixed by #2908
Closed
2 tasks

Report the version from the elastic agent package instead of agent binary #2582

joshdover opened this issue May 1, 2023 · 5 comments · Fixed by #2908
Assignees
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@joshdover
Copy link
Contributor

joshdover commented May 1, 2023

Issue

We need to be able to repackage Agent without rebuilding the Agent binary, and still have Agent report the updated version number at runtime. The repackaging step will be created as part of #2498

This requires that agent reads its version from a plaintext file that can be updated as part of the packaging step, rather than written directly into the binary.

Suggested solution

Implement after #2579 to use the full version number contains in the parent directory.

Definition of done

  • The Agent is reporting the correct version and not a fixed one from building steps.
  • Tests are in place to confirm that the full version is the one reported.
@joshdover joshdover added the Team:Elastic-Agent Label for the Agent team label May 1, 2023
@cmacknz
Copy link
Member

cmacknz commented May 1, 2023

This requires that agent reads its version from a plaintext file that can be updated as part of the packaging step, rather than written directly into the binary.

Depending on what we do in #2579 (comment), another option could be for the agent to report the version number from its parent directory e.g. elastic-agent-7ac68h-8.8.1.er1.

@jlind23
Copy link
Contributor

jlind23 commented May 15, 2023

Moving this to a later sprint as the plan changed a bit.

@joshdover
Copy link
Contributor Author

We are moving this back into the sprint. cc @pchila

@pchila
Copy link
Member

pchila commented Jun 9, 2023

Since the version command is usable even without the agent being installed I am going with the solution of a file being created and packaged in the agent (similar to what we already do with the build_hash.txt.
As for the version format I am going with the same structure as we use for the agent version:
elastic-agent-x.y.z[-SNAPSHOT]+<commithash> which differs from the released version x.y.z[-SNAPSHOT]+<buildid> (the part after the + is a different identifier.
Is that acceptable ?

@cmacknz
Copy link
Member

cmacknz commented Jun 12, 2023

elastic-agent-x.y.z[-SNAPSHOT]+ which differs from the released version x.y.z[-SNAPSHOT]+ (the part after the + is a different identifier.

Yes, using instead of seems preferable here, since the buildid is hard to tie back to a specific set of commits on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants