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

Fix a bunch of errorlint errors from our linters #360

Merged
merged 7 commits into from
Apr 27, 2022
Merged

Conversation

ph
Copy link
Contributor

@ph ph commented Apr 21, 2022

This fixes a lot of the error detecting by our linters, this skip the
errors related to the errors packages, we should refactor the usage or
our package instead.

What does this PR do?

Why is it important?

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

Related issues

Use cases

Screenshots

Logs

@ph ph added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-v8.3.0 Automated backport with mergify labels Apr 21, 2022
@ph ph self-assigned this Apr 21, 2022
@ph ph requested a review from a team as a code owner April 21, 2022 18:51
@ph ph requested review from lykkin and narph and removed request for a team April 21, 2022 18:51
@ph ph added ci:end-to-end Enable the e2e-testing ci:package Enable the package in the CI labels Apr 21, 2022
@ph
Copy link
Contributor Author

ph commented Apr 21, 2022

/test

@elasticmachine
Copy link
Contributor

elasticmachine commented Apr 21, 2022

💚 Build Succeeded

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-04-26T12:29:30.288+0000

  • Duration: 34 min 3 sec

Test stats 🧪

Test Results
Failed 0
Passed 3849
Skipped 21
Total 3870

🤖 GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@@ -44,7 +44,6 @@ notice:
.PHONY: check-ci
check-ci:
@mage update
@mage check
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This shouldn't be here, this actually makes the linter run twice and it should only be run by the github action.

ph added 6 commits April 25, 2022 10:52
Fixes the errorlint raised by the linter
This fixes a lot of the error detecting by our linters, this skip the
errors related to the errors packages, we should refactor the usage or
our package instead.
@ph
Copy link
Contributor Author

ph commented Apr 25, 2022

/test

Copy link
Member

@AndersonQ AndersonQ left a comment

Choose a reason for hiding this comment

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

I think you might have misses a ! on a if statement. I commented there

internal/pkg/agent/operation/operator.go Outdated Show resolved Hide resolved
@ph ph requested a review from AndersonQ April 26, 2022 12:33
Copy link
Member

@AndersonQ AndersonQ left a comment

Choose a reason for hiding this comment

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

you still have failing tests, but so far so good :)

@ph
Copy link
Contributor Author

ph commented Apr 27, 2022

@AndersonQ well the linter... is a work in progress. I think the next one is the errcheck.
@mdelapenya or @ChrsMark I see an e2e test failing on k8s, Is this a known issue or I should investigate it?


[2022-04-26T14:24:10.545Z]     Then "elastic-agent" collects events with "kubernetes.pod.name:redis" # autodiscover_test.go:295 -> *podsManager

[2022-04-26T14:24:10.545Z]     context deadline exceeded

[2022-04-26T14:24:10.545Z] TRAC[2022-04-26T14:24:09Z] Executing command                             args="[export logs --name kind-a2627034-35d0-4f57-9620-83f7ceb14414 /home/admin/e2e-testing/outputs/kubernetes-autodiscover/kind-a2627034-35d0-4f57-9620-83f7ceb14414]" command=kind env="map[]"

[2022-04-26T14:24:10.546Z] TRAC[2022-04-26T14:24:09Z] Output                                        output=/home/admin/e2e-testing/outputs/kubernetes-autodiscover/kind-a2627034-35d0-4f57-9620-83f7ceb14414

[2022-04-26T14:24:10.546Z] INFO[2022-04-26T14:24:09Z] Kind cluster logs exported                    cluster=kind-a2627034-35d0-4f57-9620-83f7ceb14414 path=/home/admin/e2e-testing/outputs/kubernetes-autodiscover/kind-a2627034-35d0-4f57-9620-83f7ceb14414

[2022-04-26T14:24:10.546Z] TRAC[2022-04-26T14:24:09Z] Executing command                             args="[delete cluster --name kind-a2627034-35d0-4f57-9620-83f7ceb14414]" command=kind env="map[]"

[2022-04-26T14:24:11.932Z] TRAC[2022-04-26T14:24:11Z] Output                                        output=

[2022-04-26T14:24:11.932Z] INFO[2022-04-26T14:24:11Z] kind cluster  was deleted                    

[2022-04-26T14:25:19.687Z] 

[2022-04-26T14:25:19.687Z] --- Failed steps:

[2022-04-26T14:25:19.687Z] 

[2022-04-26T14:25:19.687Z]   Scenario: Logs collection from running pod # features/elastic_agent_standalone.feature:9

[2022-04-26T14:25:19.687Z]     Then "elastic-agent" collects events with "kubernetes.pod.name:a-pod" # features/elastic_agent_standalone.feature:12

[2022-04-26T14:25:19.687Z]       Error: context deadline exceeded

[2022-04-26T14:25:19.687Z] 

[2022-04-26T14:25:19.687Z]   Scenario: Logs collection from a pod with an init container # features/elastic_agent_standalone.feature:14

[2022-04-26T14:25:19.687Z]     Then "elastic-agent" collects events with "kubernetes.container.name:init-container" # features/elastic_agent_standalone.feature:17

[2022-04-26T14:25:19.687Z]       Error: context deadline exceeded

[2022-04-26T14:25:19.687Z] 

[2022-04-26T14:25:19.687Z]   Scenario: Logs collection from short-living cronjobs # features/elastic_agent_standalone.feature:22

[2022-04-26T14:25:19.687Z]     Then "elastic-agent" collects events with "kubernetes.container.name:cronjob-container" # features/elastic_agent_standalone.feature:26

[2022-04-26T14:25:19.687Z]       Error: context deadline exceeded

[2022-04-26T14:25:19.687Z] 

[2022-04-26T14:25:19.687Z]   Scenario: Logs collection from failing pod # features/elastic_agent_standalone.feature:28

[2022-04-26T14:25:19.687Z]     Then "elastic-agent" collects events with "kubernetes.pod.name:a-failing-pod" # features/elastic_agent_standalone.feature:31

[2022-04-26T14:25:19.687Z]       Error: context deadline exceeded

[2022-04-26T14:25:19.687Z] 

[2022-04-26T14:25:19.687Z]   Scenario: Metrics collection configured from targeted Redis Pod # features/elastic_agent_standalone.feature:33

[2022-04-26T14:25:19.687Z]     Then "elastic-agent" collects events with "kubernetes.pod.name:redis" # features/elastic_agent_standalone.feature:36

[2022-04-26T14:25:19.687Z]       Error: context deadline exceeded

[2022-04-26T14:25:19.687Z] 

@mdelapenya
Copy link
Contributor

mdelapenya commented Apr 27, 2022

@AndersonQ well the linter... is a work in progress. I think the next one is the errcheck. @mdelapenya or @ChrsMark I see an e2e test failing on k8s, Is this a known issue or I should investigate it?

The team is working on it elastic/e2e-testing#2434, thanks for the ping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.3.0 Automated backport with mergify ci:end-to-end Enable the e2e-testing ci:package Enable the package in the CI 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.

4 participants