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

[8.x] restore cloud defend as an expected binary #6470

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

cmacknz
Copy link
Member

@cmacknz cmacknz commented Jan 2, 2025

The cloud-defend binary was accidentally removed from 8.x starting with 8.17.0 in the backport for https://github.com/elastic/elastic-agent/pull/6042/files, likely as part of merge conflict resolution.

What does this PR do?

Includes the cloud-defend binary in the agent docker container again.

Why is it important?

Defend for containers which is implemented by cloud-defend is still a supported product in 8.x.

How to test this PR locally

DOCKER_VARIANTS=basic EXTERNAL=true SNAPSHOT=true PACKAGES=docker PLATFORMS=linux/arm64 mage package

docker run -it --entrypoint /bin/bash docker.elastic.co/beats/elastic-agent:8.18.0-SNAPSHOT
elastic-agent@240c9b878938:~$ ls data/elastic-agent-1f89c7/
components  elastic-agent  logs  otelcol  package.version
elastic-agent@240c9b878938:~$ ls data/elastic-agent-1f89c7/components/
LICENSE.txt                       bundle.tar.gz          lenses
NOTICE.pf-elastic-collector.txt   certs                  module
NOTICE.pf-elastic-symbolizer.txt  checksum.yml           osquery-extension.ext
NOTICE.pf-host-agent.txt          cloud-defend           osqueryd
NOTICE.txt                        cloud-defend.spec.yml  pf-elastic-collector

Related issues

@cmacknz cmacknz added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-8.17 Automated backport with mergify labels Jan 2, 2025
@cmacknz cmacknz requested a review from swiatekm January 2, 2025 16:02
@cmacknz cmacknz requested a review from a team as a code owner January 2, 2025 16:02
@cmacknz cmacknz requested review from kaanyalti and removed request for a team January 2, 2025 16:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@mergify mergify bot assigned cmacknz Jan 2, 2025
@cmacknz cmacknz linked an issue Jan 2, 2025 that may be closed by this pull request
@cmacknz
Copy link
Member Author

cmacknz commented Jan 2, 2025

We have package tests that could catch this.

func checkDocker(t *testing.T, file string) {

My first instinct was to add a method on the ExpectedBinaries list that would return the set of binaries expected for each platform and then check that the files exist in a test. This sounds great except that it would not have caught this.

We would need to duplicate the list into the tests with a comment that it is duplicated on purpose or something. Really I think this type of problem should be getting caught at the integration level (as in Fleet integration package tests not agent integration tests).

@cmacknz
Copy link
Member Author

cmacknz commented Jan 2, 2025

Tests for this would be better placed in https://github.com/elastic/integrations/tree/main/packages/cloud_defend

@cmacknz cmacknz enabled auto-merge (squash) January 2, 2025 16:46
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@cmacknz cmacknz merged commit 79f5e13 into elastic:8.x Jan 2, 2025
13 checks passed
mergify bot pushed a commit that referenced this pull request Jan 2, 2025
* Restore cloud-defend as an expected binary.

* Add changelog.

(cherry picked from commit 79f5e13)
@cmacknz cmacknz deleted the 8.x-restore-cloud-defend branch January 2, 2025 19:15
cmacknz added a commit that referenced this pull request Jan 2, 2025
* Restore cloud-defend as an expected binary.

* Add changelog.

(cherry picked from commit 79f5e13)

Co-authored-by: Craig MacKenzie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.17 Automated backport with mergify bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud Defend binary missing from 8.17.0+ containers
3 participants