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

Cherry-pick #19317 to 7.x: Fix ordering and duplicate configs on autodiscover #19614

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Jul 2, 2020

Cherry-pick of PR #19317 to 7.x branch. Original message:

Regression

What does this PR do?

#18979 introduced a pod level event which is generated after all container events. The ordering is wrong in that pod events are sent last which would generate a valid event similar to container events. The ordering needs to be pod first and container events next so that pod events dont override valid container events. One other issue was that the pod level hint generates a single config with all hosts and it wont get over written by container hints causing more than one config to be spun up for the same hint (one with a container meta and one without)

Why is it important?

Without this, container metadata will never be emitted even if a port belongs to a valid exposed port.

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 added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Generate any event for an exposed port and make sure that container metadata is visible.

Related issues

Use cases

Screenshots

Logs

elastic#18979 introduced a pod level event which is generated after all container events.
The ordering is wrong in that pod events are sent last which would generate a valid
event similar to container events. The ordering needs to be pod first and container
events next so that pod events dont override valid container events. One other issue
was that the pod level hint generates a single config with all hosts and it wont get
over written by container hints causing more than one config to be spun up for the
same hint (one with a container meta and one without).

(cherry picked from commit 58edbb4)
@jsoriano jsoriano added [zube]: In Review backport Team:Platforms Label for the Integrations - Platforms team labels Jul 2, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 2, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 3, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [jsoriano commented: jenkins run the tests]

  • Start Time: 2020-07-03T11:33:38.908+0000

  • Duration: 123 min 55 sec

Test stats 🧪

Test Results
Failed 0
Passed 9027
Skipped 1580
Total 10607

Steps errors

Expand to view the steps failures

  • Name: Make -C filebeat testsuite

    • Description: make -C filebeat testsuite

    • Duration: 7 min 49 sec

    • Start Time: 2020-07-03T11:55:52.625+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 1 min 27 sec

    • Start Time: 2020-07-03T12:21:23.490+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-03T11:58:14.474+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-03T12:41:48.862+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-03T12:11:52.276+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-03T12:31:51.892+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-03T13:36:07.444Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-03T13:36:07.444Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-07-03T13:36:07.444Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-03T13:36:07.444Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-07-03T13:36:08.688Z] Failed in branch Filebeat x-pack
[2020-07-03T13:36:08.826Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats
[2020-07-03T13:36:09.131Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-03T13:36:09.142Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Lint
[2020-07-03T13:36:09.221Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-07-03T13:36:09.293Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-03T13:36:09.367Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-03T13:36:09.470Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-03T13:36:09.554Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-07-03T13:36:09.630Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-03T13:36:09.704Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-03T13:36:09.852Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-03T13:36:09.933Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-07-03T13:36:10.011Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-03T13:36:10.082Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-07-03T13:36:10.151Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-07-03T13:36:10.234Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-03T13:36:10.305Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Filebeat-oss
[2020-07-03T13:36:10.378Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-03T13:36:10.455Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-03T13:36:10.535Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-03T13:36:10.605Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-03T13:36:10.676Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-03T13:36:10.747Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-03T13:36:10.817Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-03T13:36:10.888Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-03T13:36:10.966Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-03T13:36:11.057Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-03T13:36:11.132Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-03T13:36:11.203Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-07-03T13:36:11.280Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-03T13:36:11.352Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Packetbeat-oss
[2020-07-03T13:36:11.426Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-03T13:36:11.497Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-03T13:36:11.583Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-07-03T13:36:11.654Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-03T13:36:11.725Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-07-03T13:36:11.794Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-07-03T13:36:11.867Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Functionbeat-Windows
[2020-07-03T13:36:11.946Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-03T13:36:12.018Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Heartbeat-Windows
[2020-07-03T13:36:12.093Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-07-03T13:36:12.176Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Libbeat-oss
[2020-07-03T13:36:12.249Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Generators-Beat-Mac-OS-X
[2020-07-03T13:36:12.320Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-07-03T13:36:12.396Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-03T13:36:12.470Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-07-03T13:36:12.541Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-03T13:36:12.612Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-03T13:36:12.972Z] + cat
[2020-07-03T13:36:12.972Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-03T13:36:12.972Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-03T13:36:19.570Z] runbld>>> runbld started
[2020-07-03T13:36:19.570Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-03T13:36:20.952Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-19614' in order of occurrence in the config (last value wins).
[2020-07-03T13:36:22.333Z] runbld>>> Debug logging enabled.
[2020-07-03T13:36:22.333Z] runbld>>> Storing result
[2020-07-03T13:36:22.593Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-03T13:36:22.593Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200703133622-C045E0E6
[2020-07-03T13:36:22.593Z] runbld>>> Adding system facts.
[2020-07-03T13:36:23.530Z] runbld>>> Adding vcs info for the latest commit:  2324e2013ea6b8e18026a2b56c92c81992b1d6c5
[2020-07-03T13:36:23.530Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-03T13:36:23.530Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-03T13:36:23.530Z] Processing JUnit reports with runbld...
[2020-07-03T13:36:23.530Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-03T13:36:23.790Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-03T13:36:23.790Z] runbld>>> DURATION: 25ms
[2020-07-03T13:36:23.790Z] runbld>>> STDOUT: 40 bytes
[2020-07-03T13:36:23.790Z] runbld>>> STDERR: 49 bytes
[2020-07-03T13:36:23.790Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-03T13:36:23.790Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats
[2020-07-03T13:36:24.728Z] runbld>>> Storing build metadata: 
[2020-07-03T13:36:24.728Z] runbld>>> Adding test report.
[2020-07-03T13:36:24.728Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats
[2020-07-03T13:36:25.664Z] runbld>>> Found 113 test output files
[2020-07-03T13:36:26.235Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-07-03T13:36:26.235Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-07-03T13:36:26.235Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-07-03T13:36:26.235Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-07-03T13:36:26.235Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-07-03T13:36:26.235Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-07-03T13:36:26.235Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-07-03T13:36:27.617Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 10457 Skipped: 1343
[2020-07-03T13:36:27.950Z] runbld>>> Storing result
[2020-07-03T13:36:27.950Z] runbld>>> FAILURES: 0
[2020-07-03T13:36:27.950Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-03T13:36:27.950Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200703133622-C045E0E6
[2020-07-03T13:36:28.209Z] runbld>>> Email notification disabled by environment variable.
[2020-07-03T13:36:28.209Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-03T13:36:33.701Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19614
[2020-07-03T13:36:33.803Z] [INFO] getVaultSecret: Getting secrets
[2020-07-03T13:36:33.860Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-03T13:36:34.617Z] + chmod 755 generate-build-data.sh
[2020-07-03T13:36:34.617Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19614/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19614/runs/3 FAILURE 7375449
[2020-07-03T13:36:34.617Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19614/runs/3/steps/?limit=10000 -o steps-info.json
[2020-07-03T13:36:36.479Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19614/runs/3/tests/?status=FAILED -o tests-errors.json

@jsoriano
Copy link
Member Author

jsoriano commented Jul 3, 2020

jenkins run the tests

@jsoriano jsoriano self-assigned this Jul 3, 2020
@jsoriano jsoriano merged commit 24b1a0b into elastic:7.x Jul 6, 2020
@jsoriano jsoriano deleted the backport_19317_7.x branch July 6, 2020 09:44
@zube zube bot removed the [zube]: Done label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants