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 is_managed behavior in preconfiguration service #115452

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Oct 18, 2021

Summary

Related to #113921

When an agent policy that was not managed become managed the preconfiguration service do not take this in account.
Also with the current implementation of the preconfiguration service we add the is_managed:true flag to a policy not during the creation of the agent policy Saved object but at the end of the preconfiguration, so if an error happen the preconfigured policy will never be updated,= never be a managed policy and some package policy could be missing (I think this happened a few time in cloud).

How to tests/Reproduce the bug

  1. add a policy to your kibana.dev.yml
xpack.fleet.agentPolicies:
  - name: Test agent policy
    id: test-policy
    monitoring_enabled: []
    package_policies: []
  1. navigate to fleet and check the policy is created
  2. Update the policy in your kibana.dev.yml
xpack.fleet.agentPolicies:
  - name: Test agent policy
    is_managed: true
    id: test-policy
    monitoring_enabled: []
    # data_output_id: output-123
    # monitoring_output_id: output-123
    package_policies:
      - package:
          name: fleet_server
        name: Fleet Server
        inputs:
          - type: fleet-server
            keep_enabled: true
  1. with my fix when you navigate to kibana you should the policy as managed (with the fleet server package policy. , not working for now)

@nchaulet nchaulet added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Oct 18, 2021
@nchaulet nchaulet requested a review from a team as a code owner October 18, 2021 20:35
@nchaulet nchaulet self-assigned this Oct 18, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet marked this pull request as draft October 18, 2021 20:38
@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 18, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/observability/public/context.HasDataContextProvider when plugins have registered all apps return false hasAnyData returns false and all apps return false

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: Timed out in waitForNextUpdate after 1000ms.
    at waitForNextUpdate (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@testing-library/react-hooks/lib/core/asyncUtils.js:102:13)
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/observability/public/context/has_data_context.test.tsx:139:11

Metrics [docs]

✅ unchanged

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

cc @nchaulet

@nchaulet nchaulet closed this Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants