Skip to content

Commit

Permalink
Remove huaweicloud - revert #27607 (#35184)
Browse files Browse the repository at this point in the history
* 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 <kaiyan.sheng@elastic.co>
(cherry picked from commit 07c559b)

# 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
  • Loading branch information
mstinsky authored and mergify[bot] committed Feb 1, 2024
1 parent ddf433c commit b699751
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions libbeat/processors/add_cloud_metadata/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ var cloudMetaProviders = map[string]provider{
"nova-ssl": openstackNovaSSLMetadataFetcher,
"qcloud": qcloudMetadataFetcher,
"tencent": qcloudMetadataFetcher,
<<<<<<< HEAD

Check failure on line 67 in libbeat/processors/add_cloud_metadata/providers.go

View workflow job for this annotation

GitHub Actions / lint (windows)

expected operand, found '<<' (typecheck)

Check failure on line 67 in libbeat/processors/add_cloud_metadata/providers.go

View workflow job for this annotation

GitHub Actions / lint (linux)

expected operand, found '<<' (typecheck)

Check failure on line 67 in libbeat/processors/add_cloud_metadata/providers.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

expected operand, found '<<' (typecheck)
"huawei": huaweiMetadataFetcher,
=======
"huawei": openstackNovaMetadataFetcher,
"hetzner": hetznerMetadataFetcher,
>>>>>>> 07c559b703 (Remove huaweicloud - revert #27607 (#35184))

Check failure on line 72 in libbeat/processors/add_cloud_metadata/providers.go

View workflow job for this annotation

GitHub Actions / lint (windows)

illegal character U+0023 '#' (typecheck)

Check failure on line 72 in libbeat/processors/add_cloud_metadata/providers.go

View workflow job for this annotation

GitHub Actions / lint (linux)

illegal character U+0023 '#' (typecheck)

Check failure on line 72 in libbeat/processors/add_cloud_metadata/providers.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

illegal character U+0023 '#' (typecheck)
}

func selectProviders(configList providerList, providers map[string]provider) map[string]provider {
Expand Down

0 comments on commit b699751

Please sign in to comment.