From b699751b8276ae7ddfa46b425295182b3722b778 Mon Sep 17 00:00:00 2001 From: Maximilian Stinsky <26960620+mstinsky@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:13:07 +0100 Subject: [PATCH] Remove huaweicloud - revert #27607 (#35184) * Remove huaweicloud - revert #27607 The huaweicloud is just openstack therefore revert #27607 to fix detection of all public and private openstack installations. * make huawei an alias for openstack * change doc * Update CHANGELOG.next.asciidoc --------- Co-authored-by: kaiyan-sheng (cherry picked from commit 07c559b703fb6d52447fd22893add4ece8b982a9) # Conflicts: # libbeat/processors/add_cloud_metadata/docs/add_cloud_metadata.asciidoc # libbeat/processors/add_cloud_metadata/provider_huawei_cloud.go # libbeat/processors/add_cloud_metadata/provider_huawei_cloud_test.go # libbeat/processors/add_cloud_metadata/providers.go --- CHANGELOG.next.asciidoc | 5 ++++ .../docs/add_cloud_metadata.asciidoc | 25 +++++++------------ .../add_cloud_metadata/providers.go | 5 ++++ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 0b90edc0fdd..97e89d36e61 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -11,6 +11,11 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d *Affecting all Beats* - Upgrade to Go 1.21.6. Removes support for Windows 8.1. See https://tip.golang.org/doc/go1.21#windows. {pull}37694[37694] +- Upgrade to Go 1.21.6. Removes support for Windows 8.1. See https://tip.golang.org/doc/go1.21#windows. {pull}37615[37615] +- add_cloud_metadata processor: `huawei` provider is now treated as `openstack`. Huawei cloud runs on OpenStack +platform, and when viewed from a metadata API standpoint, it is impossible to differentiate it from OpenStack. If you +know that your deployments run on Huawei Cloud exclusively, and you wish to have `cloud.provider` value as `huawei`, +you can achieve this by overwriting the value using an `add_fields` processor. {pull}35184[35184] *Auditbeat* diff --git a/libbeat/processors/add_cloud_metadata/docs/add_cloud_metadata.asciidoc b/libbeat/processors/add_cloud_metadata/docs/add_cloud_metadata.asciidoc index a302aa6cd0f..4cf84702405 100644 --- a/libbeat/processors/add_cloud_metadata/docs/add_cloud_metadata.asciidoc +++ b/libbeat/processors/add_cloud_metadata/docs/add_cloud_metadata.asciidoc @@ -16,7 +16,10 @@ The following cloud providers are supported: - Google Compute Engine (GCE) - https://www.qcloud.com/?lang=en[Tencent Cloud] (QCloud) - Alibaba Cloud (ECS) -- Huawei Cloud (ECS) +- Huawei Cloud (ECS)footnote:[`huawei` is an alias for `openstack`. Huawei cloud runs on OpenStack platform, and when +viewed from a metadata API standpoint, it is impossible to differentiate it from OpenStack. If you know that your +deployments run on Huawei Cloud exclusively, and you wish to have `cloud.provider` value as `huawei`, you can achieve +this by overwriting the value using an `add_fields` processor.] - Azure Virtual Machine - Openstack Nova @@ -52,10 +55,14 @@ List of names the `providers` setting supports: - "digitalocean" for Digital Ocean (enabled by default). - "aws", or "ec2" for Amazon Web Services (enabled by default). - "gcp" for Google Copmute Enging (enabled by default). -- "openstack", or "nova" for Openstack Nova (enabled by default). +- "openstack", "nova", or "huawei" for Openstack Nova (enabled by default). - "openstack-ssl", or "nova-ssl" for Openstack Nova when SSL metadata APIs are enabled (enabled by default). - "tencent", or "qcloud" for Tencent Cloud (disabled by default). +<<<<<<< HEAD - "huawei" for Huawei Cloud (enabled by default). +======= +- "hetzner" for Hetzner Cloud (enabled by default). +>>>>>>> 07c559b703 (Remove huaweicloud - revert #27607 (#35184)) The third optional configuration setting is `overwrite`. When `overwrite` is `true`, `add_cloud_metadata` overwrites existing `cloud.*` fields (`false` by @@ -126,20 +133,6 @@ _Tencent Cloud_ } ------------------------------------------------------------------------------- -_Huawei Cloud_ - -[source,json] -------------------------------------------------------------------------------- -{ - "cloud": { - "availability_zone": "cn-east-2b", - "instance.id": "37da9890-8289-4c58-ba34-a8271c4a8216", - "provider": "huawei", - "region": "cn-east-2" - } -} -------------------------------------------------------------------------------- - _Alibaba Cloud_ This metadata is only available when VPC is selected as the network type of the diff --git a/libbeat/processors/add_cloud_metadata/providers.go b/libbeat/processors/add_cloud_metadata/providers.go index 50346bcb126..200819ee38e 100644 --- a/libbeat/processors/add_cloud_metadata/providers.go +++ b/libbeat/processors/add_cloud_metadata/providers.go @@ -64,7 +64,12 @@ var cloudMetaProviders = map[string]provider{ "nova-ssl": openstackNovaSSLMetadataFetcher, "qcloud": qcloudMetadataFetcher, "tencent": qcloudMetadataFetcher, +<<<<<<< HEAD "huawei": huaweiMetadataFetcher, +======= + "huawei": openstackNovaMetadataFetcher, + "hetzner": hetznerMetadataFetcher, +>>>>>>> 07c559b703 (Remove huaweicloud - revert #27607 (#35184)) } func selectProviders(configList providerList, providers map[string]provider) map[string]provider {