Skip to content

[Fleet] Update frozen variables for preconfigured managed policies#235306

Merged
nchaulet merged 3 commits intomainfrom
feature-update-frozen-variables
Sep 18, 2025
Merged

[Fleet] Update frozen variables for preconfigured managed policies#235306
nchaulet merged 3 commits intomainfrom
feature-update-frozen-variables

Conversation

@nchaulet
Copy link
Member

@nchaulet nchaulet commented Sep 17, 2025

Summary

Resolve #234384

That PR allow to update frozen variables for managed preconfigured policies, before that change we were not able to make any change to already created preconfigured package policies, that PR change that.

Tests

I added unit test to cover that change.

Manual test
You can add the following policy and modify the value of the paths variable and see the policy updated

xpack.fleet.agentPolicies:
  # Cloud Agent policy
  - name: Elastic Cloud agent policy
    description: Default agent policy for agents hosted on Elastic Cloud
    id: policy-elastic-agent-on-cloud
    is_default: false
    is_managed: true
    is_default_fleet_server: false
    namespace: default
    package_policies:
      - name: nginx
        id: nginx-cloud
        package:
          name: nginx
        inputs:
          - type: logfile
            streams:
              - data_stream:
                  type: logs
                  dataset: nginx.error
                enabled: false
              - data_stream:
                  type: logs
                  dataset: nginx.access
                enabled: true
                vars:
                  - name: paths
                    value: [/test2/logs/nginx/access.log]
                    frozen: true
@nchaulet nchaulet marked this pull request as ready for review September 17, 2025 10:12
@nchaulet nchaulet requested a review from a team as a code owner September 17, 2025 10:12
@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Fleet Team label for Observability Data Collection Fleet team labels Sep 17, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet self-assigned this Sep 17, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1511 1512 +1
Unknown metric groups

API count

id before after diff
fleet 1643 1644 +1

History

cc @nchaulet

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

Tested locally, LGTM

@nchaulet nchaulet merged commit 2738a40 into main Sep 18, 2025
20 checks passed
@nchaulet nchaulet deleted the feature-update-frozen-variables branch September 18, 2025 07:42
@nchaulet nchaulet added backport:version Backport to applied version labels v9.1.5 v8.18.8 v8.19.5 v9.0.8 and removed backport:skip This PR does not require backporting labels Sep 24, 2025
nchaulet added a commit to nchaulet/kibana that referenced this pull request Sep 24, 2025
…lastic#235306)

(cherry picked from commit 2738a40)

# Conflicts:
#	x-pack/platform/plugins/shared/fleet/server/services/package_policy.ts
nchaulet added a commit to nchaulet/kibana that referenced this pull request Sep 24, 2025
…lastic#235306)

(cherry picked from commit 2738a40)

# Conflicts:
#	x-pack/platform/plugins/shared/fleet/server/services/package_policy.test.ts
#	x-pack/platform/plugins/shared/fleet/server/services/package_policy.ts
#	x-pack/platform/plugins/shared/fleet/server/services/preconfiguration.ts
nchaulet added a commit to nchaulet/kibana that referenced this pull request Sep 24, 2025
…lastic#235306)

(cherry picked from commit 2738a40)

# Conflicts:
#	x-pack/platform/plugins/shared/fleet/server/services/package_policy.test.ts
#	x-pack/platform/plugins/shared/fleet/server/services/package_policy.ts
@nchaulet
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
�� 9.1
9.0
8.19
8.18

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

nchaulet added a commit to nchaulet/kibana that referenced this pull request Sep 24, 2025
…lastic#235306)

(cherry picked from commit 2738a40)

# Conflicts:
#	x-pack/platform/plugins/shared/fleet/server/services/package_policy.test.ts
#	x-pack/platform/plugins/shared/fleet/server/services/package_policy.ts
#	x-pack/platform/plugins/shared/fleet/server/services/preconfiguration.ts
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 25, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @nchaulet

nchaulet added a commit that referenced this pull request Sep 25, 2025
…ies (#235306) (#236236)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Fleet] Update frozen variables for preconfigured managed policies
(#235306)](#235306)

<!--- Backport version: 10.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-09-18T07:42:10Z","message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Fleet]
Update frozen variables for preconfigured managed
policies","number":235306,"url":"https://github.com/elastic/kibana/pull/235306","mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19","9.0","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/235306","number":235306,"mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
nchaulet added a commit that referenced this pull request Sep 25, 2025
…ies (#235306) (#236239)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Fleet] Update frozen variables for preconfigured managed policies
(#235306)](#235306)

<!--- Backport version: 10.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-09-18T07:42:10Z","message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Fleet]
Update frozen variables for preconfigured managed
policies","number":235306,"url":"https://github.com/elastic/kibana/pull/235306","mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19","9.0","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/235306","number":235306,"mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nchaulet added a commit that referenced this pull request Sep 25, 2025
…cies (#235306) (#236240)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Fleet] Update frozen variables for preconfigured managed policies
(#235306)](#235306)

<!--- Backport version: 10.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-09-18T07:42:10Z","message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Fleet]
Update frozen variables for preconfigured managed
policies","number":235306,"url":"https://github.com/elastic/kibana/pull/235306","mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19","9.0","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/235306","number":235306,"mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
nchaulet added a commit that referenced this pull request Sep 25, 2025
…cies (#235306) (#236244)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Fleet] Update frozen variables for preconfigured managed policies
(#235306)](#235306)

<!--- Backport version: 10.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-09-18T07:42:10Z","message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Fleet]
Update frozen variables for preconfigured managed
policies","number":235306,"url":"https://github.com/elastic/kibana/pull/235306","mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19","9.0","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/235306","number":235306,"mergeCommit":{"message":"[Fleet]
Update frozen variables for preconfigured managed policies
(#235306)","sha":"2738a40a6ec1dc07db5864bf309a54b430f2b57a"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.18.8 v8.19.5 v9.0.8 v9.1.5 v9.2.0

4 participants