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

[Fleet] Fix POLICY_CHANGE action creation for new policy #81236

Merged

Conversation

nchaulet
Copy link
Member

Summary

Resolve #81214

the POLICY_CHANGE action (the policy that is distributed to the agent) was not correctly created for new agent action,

  • the action was created before we add the system package resulting in an incorrect action
  • the action was not creating at all when we copy a policy

This PR fix that.

How to reproduce the bug

  1. setup ingest and agents
  2. Create a policy with system metrics
  3. enroll an agent to that new action => look at the action in the elastic-action-store.yml => the inputs part is missing

@nchaulet nchaulet added bug Fixes for quality problems that affect the customer experience v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v7.10 labels Oct 20, 2020
@nchaulet nchaulet requested a review from a team October 20, 2020 19:38
@nchaulet nchaulet self-assigned this Oct 20, 2020
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 20, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@nchaulet nchaulet requested a review from jen-huang October 20, 2020 19:38
@jen-huang jen-huang added v7.10.0 and removed v7.10 labels Oct 20, 2020
@jen-huang
Copy link
Contributor

Can we add some more assertions in the complete agent flow integration test (or some other test suite) to account for the changes here and in #81041? Can be done in a follow up PR.

@nchaulet
Copy link
Member Author

Yes it will make sense to add more tests to cover all the side effect of creating/updating an agent config for agent action I will work on it in a follow up PR

@EricDavisX
Copy link
Contributor

@nchaulet I'd love to partake in any async discussions on what we need to cover here, and where you want to (Kibana FTR or the e2e-testing framework which found the bug for us, we just didn't recognize it as a new error very quickly since we have other bugs currently making noise in the test) - let me know if you want to chat, and I'd love to see what we come up with

@nchaulet
Copy link
Member Author

@EricDavisX I will be happy to talk with you on how to test this,
I think one of the easiest way to test this will be to have some tests in Kibana that can test if fleet is setup, I create a policy => I should have a corresponding POLICY_CHANGE action, I update => same, I copy , ...

@nchaulet nchaulet force-pushed the fix-policy-change-action-creation-new-policy branch from 875f19b to 16be7a6 Compare October 21, 2020 01:13
@nchaulet nchaulet force-pushed the fix-policy-change-action-creation-new-policy branch from 16be7a6 to 3096a06 Compare October 21, 2020 01:44
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

  • 💔 Build #82971 failed 16be7a6d66835975536e91b46460cfa2604fa389

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 21, 2020
…arm-phase-to-formlib

* 'master' of github.com:elastic/kibana: (55 commits)
  [UX] Fix map color variance and apply proper filter for extended stats (elastic#81106)
  [User Experience] Use EuiSelect for percentiles instead of SuperSelect (elastic#81082)
  [DOCS] Add link for monitoring ssl settings (elastic#81057)
  [test] Await loading indicator in monitoring test (elastic#81279)
  [ILM] Minor copy and link additions to cloud CTA for cold phase (elastic#80512)
  [Mappings editor] Add scaled_float and date_range comp integration tests (elastic#81287)
  [Discover] Deangularize context.app (elastic#80851)
  [O11y Overview] Add code to display/hide UX section when appropriate (elastic#80873)
  [Discover] Extend DiscoverNoResults component to show different message on error (elastic#79671)
  Fix tagcloud word overlapping (elastic#81161)
  [Security Solution] Fixes flaky test rules (elastic#81040)
  Changed the code to avoid tech debt with hacky solutions after receiving comments on EUI issue reported about this problem. (elastic#81183)
  [Security Solution][All] Replace old markdown renderer with the new one (elastic#80301)
  Add namespaced version of the API call (elastic#81278)
  [ML] Data Frame Analytics: Fix race condition and support for feature influence legacy format. (elastic#81123)
  [Fleet] Fix POLICY_CHANGE action creation for new policy (elastic#81236)
  [Security Solution][Endpoint][Admin] Malware user notification checkbox (elastic#78084)
  [SecuritySolution][Unit Tests] - fix flakey unit test (elastic#81239)
  skip flaky suite (elastic#81264)
  [Maps] fix top-level Map page is called 'Kibana' (elastic#81238)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/forcemerge_field.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase.tsx
@EricDavisX
Copy link
Contributor

@EricDavisX I will be happy to talk with you on how to test this,
I think one of the easiest way to test this will be to have some tests in Kibana that can test if fleet is setup, I create a policy => I should have a corresponding POLICY_CHANGE action, I update => same, I copy , ...

Thank you Nicolas. I have opened this to track initial discussion (and further automation if we use the e2e-testing framework) - elastic/e2e-testing#380
I don't think the Kibana FTR has the support for 'live' hosts so I'm not sure how we can test it just in the FTR if we are dependent on the acknowledgement from Agent for the validation. Let's discuss there and figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0 v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Newly created Enrollment Tokens are not working to fully deploy an Agent (no Beats come on line)
5 participants