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

Tidy up beater/config #5376

Merged
merged 3 commits into from
Jun 1, 2021
Merged

Tidy up beater/config #5376

merged 3 commits into from
Jun 1, 2021

Conversation

axw
Copy link
Member

@axw axw commented May 31, 2021

Motivation/summary

  • remove some "setup" methods, set default values before unpacking
  • unexport DefaultKibanaAgentConfig
  • de-pointer various config fields to avoid the need for nil-pointer checks, and rely on default values; remove "IsEnabled" methods in favour of setting default values for Enabled fields and accessing those directly
  • move various config types into their own files
  • remove dead validator code

How to test these changes

N/A, non-functional change.

Related issues

Setting up for implementing #5347

- remove some "setup" methods, set default values before unpacking
- unexport DefaultKibanaAgentConfig
- de-pointer various config fields to avoid the need for nil-pointer
  checks, and rely on default values; remove "IsEnabled" methods in
  favour of setting default values for Enabled fields
- move various config types into their own files
- remove dead validator code
@axw axw added the v7.14.0 label May 31, 2021
@apmmachine
Copy link
Contributor

apmmachine commented May 31, 2021

💚 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

Expand to view the summary

Build stats

  • Build Cause: Pull request #5376 updated

  • Start Time: 2021-05-31T12:32:07.201+0000

  • Duration: 37 min 26 sec

  • Commit: 0606466

Test stats 🧪

Test Results
Failed 0
Passed 6142
Skipped 120
Total 6262

Trends 🧪

Image of Build Times

Image of Tests

@axw axw requested a review from a team May 31, 2021 13:28
Copy link
Contributor

@stuartnelson3 stuartnelson3 left a comment

Choose a reason for hiding this comment

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

one comment, but that's all 👍

}

func (s *AgentConfig) setup() error {
if !s.Service.isValid() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The validation checks for service are preventing kibana-generated apm-server configs from starting, since selecting "name=all" and "envirohnment=all" results in service being marshaled as {} (978acd4). Adding this as a note in case there's a conflict between PRs.

@axw axw merged commit b0c4307 into elastic:master Jun 1, 2021
@axw axw deleted the config-tidy branch June 1, 2021 07:39
mergify bot pushed a commit that referenced this pull request Jun 1, 2021
* Tidy up beater/config

- remove some "setup" methods, set default values before unpacking
- unexport DefaultKibanaAgentConfig
- de-pointer various config fields to avoid the need for nil-pointer
  checks, and rely on default values; remove "IsEnabled" methods in
  favour of setting default values for Enabled fields
- move various config types into their own files
- remove dead validator code

* beater/config: remove now-pointless test

(cherry picked from commit b0c4307)
axw added a commit that referenced this pull request Jun 1, 2021
* Tidy up beater/config

- remove some "setup" methods, set default values before unpacking
- unexport DefaultKibanaAgentConfig
- de-pointer various config fields to avoid the need for nil-pointer
  checks, and rely on default values; remove "IsEnabled" methods in
  favour of setting default values for Enabled fields
- move various config types into their own files
- remove dead validator code

* beater/config: remove now-pointless test

(cherry picked from commit b0c4307)

Co-authored-by: Andrew Wilkins <axw@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants