kibana/x-pack/test/plugin_api_integration
Lola f8e31e5fcb
[Cloud Security] Add upgrade agentless deployment background task (#207143)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.
This PR add background task to upgrade Agentless Deployments after
Kibana Stack has been upgrade in ESS. Once the Kibana stack upgrades, the task will do following:
1.  Fetch agentless policies with package policies that have agents
2. Check if agentless agents version is upgradeable by use `semverLT`
which see if current agent version less than latest available upgrade
version and current kibana version
3. If agent version is upgradedable, then task will calls Agentless
Upgrade Endpoint to upgrade agentless deployment.
4.  Agent should be upgraded to latest available upgraded version


![image](https://github.com/user-attachments/assets/e1ad05bf-469e-4eb8-bef0-b4e2edcbb0a0)


**How to test PR:**

Prerequisite:
Install [QAF
Tool](https://docs.elastic.dev/appex-qa/qaf/getting-started)
Create EC cloud api key [QAF Elastic
Cloud](https://docs.elastic.dev/appex-qa/qaf/features/ec-deployments)

1. Go to Elastic Cloud and Create ESS Deployment in `8.17.0-SNAPSHOT`
```qaf elastic-cloud deployments create --environment production --region gcp-us-west2 --stack-version 8.17.0-SNAPSHOT --version-validation --deployment-name  <DEPLOYMENT_NAME> ```
2. Create an Agentless Integration
3. Upgrade stack to `8.18.0-SNAPSHOT` > `8.19.0-SNAPSHOT`
4. Run the following QAF command 
```qaf elastic-cloud deployments upgrade <DEPLOYMENT_NAME>
9.1.0-SNAPSHOT --kb-docker-image
docker.elastic.co/kibana-ci/kibana-cloud:9.1.0-SNAPSHOT-5e00106755e7084d1325e784eb27f91db9724c89```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-27 08:56:23 +07:00
..
plugins Upgrade ES client to 9.0.0-alpha.3 (#208776) 2025-02-25 14:37:23 +00:00
test_suites [Cloud Security] Add upgrade agentless deployment background task (#207143) 2025-02-27 08:56:23 +07:00
config.ts [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
ftr_provider_context.d.ts [kbn/test] move types/ftr into src (#99555) 2021-05-17 09:51:53 -07:00
services.ts