Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix: agent directories must belong to root #2590

Merged
merged 3 commits into from
Jun 2, 2022

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Jun 1, 2022

  • chore: store agent pat into the metadata struct of the agent package
  • chore: create agent directories for UNIX-based agent installers

What does this PR do?

It adds a new field in the struct representing the agent metadata to store the base path where the agent will be installed under Linux/Darwin systems.

This path will be created in the target system at the PreInstall phase, so that it has the right permissions beforehand.

Why is it important?

This agent path, according to elastic/elastic-agent#398, must belong to root. And this applies only to 8.3 and main.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • 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 works
  • I have run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Related issues

@mdelapenya mdelapenya added Team:Automation Label for the Observability productivity team backport-v7.17.0 Automated backport with mergify backport-v8.2.0 Automated backport with mergify backport-v8.3.0 Automated backport with mergify labels Jun 1, 2022
@mdelapenya mdelapenya self-assigned this Jun 1, 2022
@mdelapenya mdelapenya requested a review from a team June 1, 2022 10:44
@mdelapenya mdelapenya removed backport-v8.2.0 Automated backport with mergify backport-v7.17.0 Automated backport with mergify labels Jun 1, 2022
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 1, 2022

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-06-01T14:50:24.112+0000

  • Duration: 92 min 9 sec

Test stats 🧪

Test Results
Failed 1
Passed 308
Skipped 0
Total 309

Test errors 1

Expand to view the tests failures

Initializing / End-To-End Tests / kubernetes-autodiscover_debian_amd64_elastic-agent / [empty] – TEST-kubernetes-autodiscover_debian_amd64_elastic-agent-3726dfb8-2022-06-01-15:44:13.xml
  • no error details
  • Expand to view the stacktrace

     Test report file /var/lib/jenkins/workspace/PR-2590-2-338bd586-9160-416b-872a-f61b458cc51e/outputs/3.16.159.150/TEST-kubernetes-autodiscover_debian_amd64_elastic-agent-3726dfb8-2022-06-01-15:44:13.xml was length 0 
    

Steps errors 2

Expand to view the steps failures

Executing ansible-playbook
  • Took 22 min 21 sec . View more details here
  • Description: /var/lib/jenkins/workspace/2e-tests_e2e-testing-mbp_PR-2590/.venv/bin/ansible-playbook --private-key="/var/lib/jenkins/workspace/2e-tests_e2e-testing-mbp_PR-2590/src/github.com/elastic/e2e-testing/e2essh" --extra-vars="workspace=/var/lib/jenkins/workspace/2e-tests_e2e-testing-mbp_PR-2590/src/github.com/elastic/e2e-testing/ runId=a1577a69 sshPublicKey=/var/lib/jenkins/workspace/2e-tests_e2e-testing-mbp_PR-2590/src/github.com/elastic/e2e-testing/e2essh.pub" --ssh-common-args='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' /var/lib/jenkins/workspace/2e-tests_e2e-testing-mbp_PR-2590/src/github.com/elastic/e2e-testing/.ci/ansible/playbook.yml -i "3.20.238.84," -t setup-stack --extra-vars="buildURL=https://beats-ci.elastic.co/job/e2e-tests/job/e2e-testing-mbp/job/PR-2590/2/ gitSha=3bd7516c7716291d4e014a8cda7b2e3ead4e56b9 build=2 repo=e2e-testing branch=pr-2590 type=ci stackRunner=3.20.238.84 nodeLabel=stack nodeUser=admin nodeImage=ami-0d90bed76900e679a nodeInstanceType=t3.xlarge"
Sleep
  • Took 0 min 5 sec . View more details here
  • Description: 5

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 1

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Initializing / End-To-End Tests / kubernetes-autodiscover_debian_amd64_elastic-agent / [empty] – TEST-kubernetes-autodiscover_debian_amd64_elastic-agent-3726dfb8-2022-06-01-15:44:13.xml

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@mdelapenya mdelapenya merged commit 274a01a into elastic:main Jun 2, 2022
mergify bot pushed a commit that referenced this pull request Jun 2, 2022
* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

(cherry picked from commit 274a01a)
mdelapenya added a commit that referenced this pull request Jun 2, 2022
* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

(cherry picked from commit 274a01a)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
@mdelapenya mdelapenya deleted the fix-non-root branch June 3, 2022 05:27
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Jun 3, 2022
* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Jun 3, 2022
* main:
  Add test scenario for elastic agent tags (elastic#2552)
  bump stack version 8.4.0-3525aaf7 (elastic#2597)
  bump stack version 8.4.0-df27a645 (elastic#2591)
  fix: agent directories must belong to root (elastic#2590)
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Jun 3, 2022
* main:
  Add test scenario for elastic agent tags (elastic#2552)
  bump stack version 8.4.0-3525aaf7 (elastic#2597)
  bump stack version 8.4.0-df27a645 (elastic#2591)
  fix: agent directories must belong to root (elastic#2590)
  chore: bump maintenance versions in mergify (elastic#2563)
mdelapenya added a commit that referenced this pull request Jun 3, 2022
* docs: document AWS requirements

* fix: typo

* fix: agent directories must belong to root (#2590)

* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

* bump stack version 8.4.0-df27a645 (#2591)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* bump stack version 8.4.0-3525aaf7 (#2597)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>

* Add test scenario for elastic agent tags (#2552)

* add flags

* gitignore

* gitignore

* typo

* quotes

* remove quotes

* remove restart

* Update e2e/_suites/fleet/fleet.go

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* docs: improve docs about adding a new platform

* docs: better explained that there are more files

Co-authored-by: apmmachine <58790750+apmmachine@users.noreply.github.com>
Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Mariana Dima <mariana@elastic.co>
mergify bot pushed a commit that referenced this pull request Jun 3, 2022
* docs: document AWS requirements

* fix: typo

* fix: agent directories must belong to root (#2590)

* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

* bump stack version 8.4.0-df27a645 (#2591)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* bump stack version 8.4.0-3525aaf7 (#2597)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>

* Add test scenario for elastic agent tags (#2552)

* add flags

* gitignore

* gitignore

* typo

* quotes

* remove quotes

* remove restart

* Update e2e/_suites/fleet/fleet.go

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* docs: improve docs about adding a new platform

* docs: better explained that there are more files

Co-authored-by: apmmachine <58790750+apmmachine@users.noreply.github.com>
Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Mariana Dima <mariana@elastic.co>
(cherry picked from commit bea0ea7)
mergify bot pushed a commit that referenced this pull request Jun 3, 2022
* docs: document AWS requirements

* fix: typo

* fix: agent directories must belong to root (#2590)

* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

* bump stack version 8.4.0-df27a645 (#2591)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* bump stack version 8.4.0-3525aaf7 (#2597)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>

* Add test scenario for elastic agent tags (#2552)

* add flags

* gitignore

* gitignore

* typo

* quotes

* remove quotes

* remove restart

* Update e2e/_suites/fleet/fleet.go

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* docs: improve docs about adding a new platform

* docs: better explained that there are more files

Co-authored-by: apmmachine <58790750+apmmachine@users.noreply.github.com>
Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Mariana Dima <mariana@elastic.co>
(cherry picked from commit bea0ea7)
mergify bot pushed a commit that referenced this pull request Jun 3, 2022
* docs: document AWS requirements

* fix: typo

* fix: agent directories must belong to root (#2590)

* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

* bump stack version 8.4.0-df27a645 (#2591)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* bump stack version 8.4.0-3525aaf7 (#2597)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>

* Add test scenario for elastic agent tags (#2552)

* add flags

* gitignore

* gitignore

* typo

* quotes

* remove quotes

* remove restart

* Update e2e/_suites/fleet/fleet.go

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* docs: improve docs about adding a new platform

* docs: better explained that there are more files

Co-authored-by: apmmachine <58790750+apmmachine@users.noreply.github.com>
Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Mariana Dima <mariana@elastic.co>
(cherry picked from commit bea0ea7)
mdelapenya added a commit that referenced this pull request Jun 6, 2022
* docs: document AWS requirements

* fix: typo

* fix: agent directories must belong to root (#2590)

* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

* bump stack version 8.4.0-df27a645 (#2591)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* bump stack version 8.4.0-3525aaf7 (#2597)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>

* Add test scenario for elastic agent tags (#2552)

* add flags

* gitignore

* gitignore

* typo

* quotes

* remove quotes

* remove restart

* Update e2e/_suites/fleet/fleet.go

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* docs: improve docs about adding a new platform

* docs: better explained that there are more files

Co-authored-by: apmmachine <58790750+apmmachine@users.noreply.github.com>
Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Mariana Dima <mariana@elastic.co>
(cherry picked from commit bea0ea7)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Jun 6, 2022
* docs: document AWS requirements

* fix: typo

* fix: agent directories must belong to root (#2590)

* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

* bump stack version 8.4.0-df27a645 (#2591)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* bump stack version 8.4.0-3525aaf7 (#2597)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>

* Add test scenario for elastic agent tags (#2552)

* add flags

* gitignore

* gitignore

* typo

* quotes

* remove quotes

* remove restart

* Update e2e/_suites/fleet/fleet.go

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* docs: improve docs about adding a new platform

* docs: better explained that there are more files

Co-authored-by: apmmachine <58790750+apmmachine@users.noreply.github.com>
Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Mariana Dima <mariana@elastic.co>
(cherry picked from commit bea0ea7)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Jun 6, 2022
* docs: document AWS requirements

* fix: typo

* fix: agent directories must belong to root (#2590)

* chore: store agent pat into the metadata struct of the agent package

* chore: create agent directories for UNIX-based agent installers

* bump stack version 8.4.0-df27a645 (#2591)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* bump stack version 8.4.0-3525aaf7 (#2597)

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>

* Add test scenario for elastic agent tags (#2552)

* add flags

* gitignore

* gitignore

* typo

* quotes

* remove quotes

* remove restart

* Update e2e/_suites/fleet/fleet.go

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>

* docs: improve docs about adding a new platform

* docs: better explained that there are more files

Co-authored-by: apmmachine <58790750+apmmachine@users.noreply.github.com>
Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Mariana Dima <mariana@elastic.co>
(cherry picked from commit bea0ea7)

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Jun 17, 2022
* main: (22 commits)
  chore(jjbb): increase build timeout to 2h (elastic#2661)
  chore: increase build timeout to 2h (elastic#2660)
  feat: run tests on windows 2019 (elastic#2468)
  Remove aws instance reaper Jenkins job (elastic#2647)
  Update k8s version to v1.24 (elastic#2644)
  chore: simplify extracting info from the supported platforms (elastic#2637)
  ci: avoid running on branches that are not available anymore (elastic#2627)
  Add support for Debian 11 and Ubuntu 22.04 platforms (elastic#2603)
  fix: retire 8.1 snapshot from upgrades (elastic#2616)
  bump stack version 8.4.0-42ce0eef (elastic#2613)
  docs: document AWS requirements (elastic#2589)
  chore: move elastic-agent's k8s-autodiscover scenarios from beats to elastic-agent profile (elastic#2601)
  Add test scenario for elastic agent tags (elastic#2552)
  bump stack version 8.4.0-3525aaf7 (elastic#2597)
  bump stack version 8.4.0-df27a645 (elastic#2591)
  fix: agent directories must belong to root (elastic#2590)
  chore: bump maintenance versions in mergify (elastic#2563)
  chore: bump kubernetes versions (elastic#2562)
  fix: use fixed, valid version for protobuffers (elastic#2569)
  chore: do not run apm-server helm chart scenarios for Beats (elastic#2564)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport-v8.3.0 Automated backport with mergify Team:Automation Label for the Observability productivity team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants