Commit d126c89
[Fleet] Added
Part of elastic/ingest-dev#4721
Added `required_versions` to agent policy and API with validation, added
unit tests for the validation.
UI change will come in another pr
To test:
- enable FF in `kibana.dev.yml`
- `xpack.fleet.enableExperimental: ['enableAutomaticAgentUpgrades']`
- create/update an agent policy with `required_versions`
- add to preconfiguration
- `required_versions` is not added to the full agent policy in
`.fleet-policies`
```
POST kbn:/api/fleet/agent_policies
{
"name": "Test versions",
"namespace": "default",
"required_versions": [
{
"version": "9.0.0",
"percentage": 5
}
]
}
POST kbn:/api/fleet/agent_policies
{
"name": "Test versions 2",
"namespace": "default",
"required_versions": [
{
"version": "9.0.0",
"percentage": 5
},
{
"version": "9.0.0",
"percentage": 5
}
]
}
{
"statusCode": 400,
"error": "Bad Request",
"message": """Policy "Test versions 2" failed validation: duplicate versions not allowed in required_versions"""
}
PUT kbn:/api/fleet/agent_policies/fleet-first-agent-policy
{
"name": "My first agent policy",
"namespace": "default",
"required_versions": [
{
"version": "8.18.0",
"percentage": 10
},
{
"version": "8.19.0",
"percentage": 5
}
]
}
GET kbn:/api/fleet/agent_policies/test-preconfigured
GET .fleet-policies/_search?q=policy_id:fleet-first-agent-policy
{
"size": 1,
"sort": [
{
"revision_idx": {
"order": "desc"
}
}
]
}
xpack.fleet.agentPolicies:
- name: Test preconfigured
id: test-preconfigured
is_managed: true
namespace: default
monitoring_enabled: []
package_policies: []
required_versions:
- version: "9.0.0"
percentage: 10
- version: "9.1.0"
percentage: 5
```
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
---------
Co-authored-by: kibanamachine <[email protected]>required_versions to agent policy and API with validation (elastic#206600)1 parent 26a3136 commit d126c89
File tree
10 files changed
+387
-32
lines changed- oas_docs/output
- x-pack
- test/fleet_api_integration
- apis/agent_policy
10 files changed
+387
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14249 | 14249 | | |
14250 | 14250 | | |
14251 | 14251 | | |
| 14252 | + | |
| 14253 | + | |
| 14254 | + | |
| 14255 | + | |
| 14256 | + | |
| 14257 | + | |
| 14258 | + | |
| 14259 | + | |
| 14260 | + | |
| 14261 | + | |
| 14262 | + | |
| 14263 | + | |
| 14264 | + | |
| 14265 | + | |
| 14266 | + | |
| 14267 | + | |
| 14268 | + | |
| 14269 | + | |
14252 | 14270 | | |
14253 | 14271 | | |
14254 | 14272 | | |
| |||
14517 | 14535 | | |
14518 | 14536 | | |
14519 | 14537 | | |
| 14538 | + | |
| 14539 | + | |
| 14540 | + | |
| 14541 | + | |
| 14542 | + | |
| 14543 | + | |
| 14544 | + | |
| 14545 | + | |
| 14546 | + | |
| 14547 | + | |
| 14548 | + | |
| 14549 | + | |
| 14550 | + | |
| 14551 | + | |
| 14552 | + | |
| 14553 | + | |
| 14554 | + | |
| 14555 | + | |
14520 | 14556 | | |
14521 | 14557 | | |
14522 | 14558 | | |
| |||
15097 | 15133 | | |
15098 | 15134 | | |
15099 | 15135 | | |
| 15136 | + | |
| 15137 | + | |
| 15138 | + | |
| 15139 | + | |
| 15140 | + | |
| 15141 | + | |
| 15142 | + | |
| 15143 | + | |
| 15144 | + | |
| 15145 | + | |
| 15146 | + | |
| 15147 | + | |
| 15148 | + | |
| 15149 | + | |
| 15150 | + | |
| 15151 | + | |
| 15152 | + | |
| 15153 | + | |
15100 | 15154 | | |
15101 | 15155 | | |
15102 | 15156 | | |
| |||
15769 | 15823 | | |
15770 | 15824 | | |
15771 | 15825 | | |
| 15826 | + | |
| 15827 | + | |
| 15828 | + | |
| 15829 | + | |
| 15830 | + | |
| 15831 | + | |
| 15832 | + | |
| 15833 | + | |
| 15834 | + | |
| 15835 | + | |
| 15836 | + | |
| 15837 | + | |
| 15838 | + | |
| 15839 | + | |
| 15840 | + | |
| 15841 | + | |
| 15842 | + | |
| 15843 | + | |
15772 | 15844 | | |
15773 | 15845 | | |
15774 | 15846 | | |
| |||
16421 | 16493 | | |
16422 | 16494 | | |
16423 | 16495 | | |
| 16496 | + | |
| 16497 | + | |
| 16498 | + | |
| 16499 | + | |
| 16500 | + | |
| 16501 | + | |
| 16502 | + | |
| 16503 | + | |
| 16504 | + | |
| 16505 | + | |
| 16506 | + | |
| 16507 | + | |
| 16508 | + | |
| 16509 | + | |
| 16510 | + | |
| 16511 | + | |
| 16512 | + | |
| 16513 | + | |
16424 | 16514 | | |
16425 | 16515 | | |
16426 | 16516 | | |
| |||
16688 | 16778 | | |
16689 | 16779 | | |
16690 | 16780 | | |
| 16781 | + | |
| 16782 | + | |
| 16783 | + | |
| 16784 | + | |
| 16785 | + | |
| 16786 | + | |
| 16787 | + | |
| 16788 | + | |
| 16789 | + | |
| 16790 | + | |
| 16791 | + | |
| 16792 | + | |
| 16793 | + | |
| 16794 | + | |
| 16795 | + | |
| 16796 | + | |
| 16797 | + | |
| 16798 | + | |
16691 | 16799 | | |
16692 | 16800 | | |
16693 | 16801 | | |
| |||
17268 | 17376 | | |
17269 | 17377 | | |
17270 | 17378 | | |
| 17379 | + | |
| 17380 | + | |
| 17381 | + | |
| 17382 | + | |
| 17383 | + | |
| 17384 | + | |
| 17385 | + | |
| 17386 | + | |
| 17387 | + | |
| 17388 | + | |
| 17389 | + | |
| 17390 | + | |
| 17391 | + | |
| 17392 | + | |
| 17393 | + | |
| 17394 | + | |
| 17395 | + | |
| 17396 | + | |
17271 | 17397 | | |
17272 | 17398 | | |
17273 | 17399 | | |
| |||
17940 | 18066 | | |
17941 | 18067 | | |
17942 | 18068 | | |
| 18069 | + | |
| 18070 | + | |
| 18071 | + | |
| 18072 | + | |
| 18073 | + | |
| 18074 | + | |
| 18075 | + | |
| 18076 | + | |
| 18077 | + | |
| 18078 | + | |
| 18079 | + | |
| 18080 | + | |
| 18081 | + | |
| 18082 | + | |
| 18083 | + | |
| 18084 | + | |
| 18085 | + | |
| 18086 | + | |
17943 | 18087 | | |
17944 | 18088 | | |
17945 | 18089 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
Lines changed: 85 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
408 | 412 | | |
409 | 413 | | |
410 | 414 | | |
| 415 | + | |
411 | 416 | | |
412 | 417 | | |
413 | 418 | | |
| |||
708 | 713 | | |
709 | 714 | | |
710 | 715 | | |
| 716 | + | |
711 | 717 | | |
712 | 718 | | |
713 | 719 | | |
| |||
0 commit comments