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

Flatten BuildConfigFromFlags to avoid warning logs on k8s client creation #18964

Merged
merged 2 commits into from
Jun 5, 2020

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Jun 4, 2020

What does this PR do?

This PR fixes #18961, by implementing client configuration creation on Beats side in order to avoid the annoying warning logs of client-go.

This happens by replacing

cfg, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
call with a call to a method of ours which implements the same logic without the logging.

Why is it important?

In order to avoid the annoying warning logs of client-go.

Closes #18961

…creation

Signed-off-by: chrismark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark added bug Team:Platforms Label for the Integrations - Platforms team labels Jun 4, 2020
@ChrsMark ChrsMark requested review from a team June 4, 2020 09:09
@ChrsMark ChrsMark self-assigned this Jun 4, 2020
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 4, 2020
@ChrsMark ChrsMark changed the title Flatten BuildConfigFromFlags to avoid warning los on k8s client creation Flatten BuildConfigFromFlags to avoid warning logs on k8s client creation Jun 4, 2020
Signed-off-by: chrismark <chrismarkou92@gmail.com>
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 4, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #18964 updated, Started by user Chris Mark, Rebuilds build #2]

  • Start Time: 2020-06-04T09:19:16.370+0000

  • Duration: 80 min 56 sec

Test stats 🧪

Test Results
Failed 0
Passed 9317
Skipped 1574
Total 10891

Steps errors

Expand to view the steps failures

  • 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-06-04T10:22:50.801+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-06-04T09:45:23.667+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-06-04T10:08:21.415+0000

    • log

@ChrsMark ChrsMark requested a review from exekias June 5, 2020 07:11
Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix! I guess this doesn't require a changelog as the the client-go update was not released

@ChrsMark
Copy link
Member Author

ChrsMark commented Jun 5, 2020

Great fix! I guess this doesn't require a changelog as the the client-go update was not released

Yeap, all this stuff targets 7.9.

@ChrsMark ChrsMark merged commit e3fcb7e into elastic:master Jun 5, 2020
ChrsMark added a commit to ChrsMark/beats that referenced this pull request Jun 5, 2020
@ChrsMark ChrsMark added the v7.9.0 label Jun 5, 2020
ChrsMark added a commit that referenced this pull request Jun 5, 2020
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Team:Platforms Label for the Integrations - Platforms team v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle k8s.io/client-go warnings
3 participants