[Elastic Agent] Fix status and inspect command to work inside running container#25204
Conversation
|
Pinging @elastic/agent (Team:Agent) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
ruflin
left a comment
There was a problem hiding this comment.
LGTM. Did not run it locally but code change makes sense.
Would be nice to also add these kind of things to our e2e test suite or something that is closer to the PR.
| } | ||
|
|
||
| func writeContainerPaths(original, statePath, configPath, logsPath string) error { | ||
| pathFile := filepath.Join(original, "container-paths.yml") |
There was a problem hiding this comment.
Do we need a new file for this or could we use an existing "state" file?
There was a problem hiding this comment.
It is only specific to running in container mode. Being that Elastic Agent ships with pre-built binaries and the state will normally be mounted from a volume we need to do a lot to ensure that the containers paths are correct.
The code will not know the path of state.yml because that is based on the STATE_PATH adjusting that location. So we use a unique file to just do this one thing, for the status and inspect commands. All other commands should either not be used in the container or are used as children of the container command itself.
…-github-pr-comment-template * upstream/master: Add support for parsers in filestream input (elastic#24763) Skip flaky test TestFilestreamTruncate (elastic#25218) backport: Add 7.13 branch (elastic#25189) Update decode_json_fields.asciidoc (elastic#25056) [Elastic Agent] Fix status and inspect command to work inside running container (elastic#25204)
…ng-versions-stack * upstream/master: (28 commits) Add support for parsers in filestream input (elastic#24763) Skip flaky test TestFilestreamTruncate (elastic#25218) backport: Add 7.13 branch (elastic#25189) Update decode_json_fields.asciidoc (elastic#25056) [Elastic Agent] Fix status and inspect command to work inside running container (elastic#25204) Check native environment before starting (elastic#25186) Change event.code and winlog.event_id type (elastic#25176) [Ingest Manager] Proxy processes/elastic-agent to stats (elastic#25193) Update mergify backporting to 7.x and 7.13 (elastic#25196) [Heartbeat]: ensure synthetics version co* [Heartbeat]: ensure synthetics version compatability for suites * address review and fix notice * fix lowercase struct * fix version conflict and rebase * update go.* stuff to master * fix notice.txt * move validate inside sourcempatability for suites (elastic#24777) [Filebeat] Ensure Kibana audit `event.category` and `event.type` are still processed as strings. (elastic#25101) Update replace.asciidoc (elastic#25055) Fix nil panic when overwriting metadata (elastic#24741) [Filebeat] Add Malware Bazaar to Threat Intel Module (elastic#24570) Fix k8s svc selectors mapping (elastic#25169) [Ingest Manager] Make agent retry values for bootstraping configurable (elastic#25163) [Metricbeat] Remove elasticsearc.index.created from the SM code (elastic#25113) [Ingest Manager] Keep http and logging config during enroll (elastic#25132) Refactor kubernetes autodiscover to avoid skipping short-living pods (elastic#24742) [libbeat] New decode xml wineventlog processor (elastic#25115) ...
What does this PR do?
Fixes issue where the
statusandinspectcommand did not work. This has to do with how thecontainercommand must setup the paths so it works correctly in a container.Why is it important?
So the
statusand theinspectcommand can work inside of a container, without setting a special environment for it to work.Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Related issues