From a289194982482eba72aa610ebaaddb4c20e9eced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Farias?= Date: Thu, 14 Mar 2024 15:02:03 +0100 Subject: [PATCH] Improve comments --- internal/inventory/asset.go | 24 ++++++++++++++++++++---- internal/inventory/aws/fetcher_ec2.go | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/internal/inventory/asset.go b/internal/inventory/asset.go index 2daff0eb8c..dd2aac75a8 100644 --- a/internal/inventory/asset.go +++ b/internal/inventory/asset.go @@ -23,21 +23,37 @@ import ( "fmt" ) +// assetCategory is used to build the document index. Use only numbers, letters and dashes (-) type assetCategory string -type assetSubCategory string -type assetType string -type assetSubType string -type assetCloudProvider string const ( CategoryInfrastructure assetCategory = "infrastructure" +) +// assetSubCategory is used to build the document index. Use only numbers, letters and dashes (-) +type assetSubCategory string + +const ( SubCategoryCompute assetSubCategory = "compute" +) + +// assetType is used to build the document index. Use only numbers, letters and dashes (-) +type assetType string +const ( TypeVirtualMachine assetType = "virtual-machine" +) + +// assetSubType is used to build the document index. Use only numbers, letters and dashes (-) +type assetSubType string +const ( SubTypeEC2 assetSubType = "ec2" +) +type assetCloudProvider string + +const ( AwsCloudProvider assetCloudProvider = "aws" ) diff --git a/internal/inventory/aws/fetcher_ec2.go b/internal/inventory/aws/fetcher_ec2.go index 003b9cb21e..048203a83c 100644 --- a/internal/inventory/aws/fetcher_ec2.go +++ b/internal/inventory/aws/fetcher_ec2.go @@ -57,7 +57,7 @@ func newEc2Fetcher(logger *logp.Logger, identity *cloud.Identity, cfg aws.Config func (e *Ec2Fetcher) Fetch(ctx context.Context, assetChannel chan<- inventory.AssetEvent) { instances, err := e.provider.DescribeInstances(ctx) if err != nil { - e.logger.Errorf("Could not list ec2 instances (%v)", err) + e.logger.Errorf("Could not list ec2 instances: %v", err) return }