From e19435ce5696697b383858c7c7401ffd5fe12549 Mon Sep 17 00:00:00 2001 From: Kulwant Singh Date: Thu, 29 Feb 2024 10:15:36 -0800 Subject: [PATCH] Use windows constant --- .../internal/k8swindows/k8swindows.go | 2 +- receiver/awscontainerinsightreceiver/internal/stores/utils.go | 2 +- .../awscontainerinsightreceiver/internal/stores/utils_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows.go b/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows.go index d8926e5814bd..922c09229135 100644 --- a/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows.go +++ b/receiver/awscontainerinsightreceiver/internal/k8swindows/k8swindows.go @@ -131,7 +131,7 @@ func (k *K8sWindows) decorateMetrics(windowsmetrics []*stores.RawContainerInsigh tags[ci.ClusterNameKey] = k.hostInfo.GetClusterName() // add tags for OS - tags[ci.OperatingSystem] = "windows" + tags[ci.OperatingSystem] = ci.OperatingSystemWindows out := k.k8sDecorator.Decorate(m) if out != nil { diff --git a/receiver/awscontainerinsightreceiver/internal/stores/utils.go b/receiver/awscontainerinsightreceiver/internal/stores/utils.go index f7ebc2559617..f82751e45398 100644 --- a/receiver/awscontainerinsightreceiver/internal/stores/utils.go +++ b/receiver/awscontainerinsightreceiver/internal/stores/utils.go @@ -98,7 +98,7 @@ func stringInRuneset(name, subset string) bool { } func TagMetricSource(metric CIMetric) { - if metric.GetTag(ci.OperatingSystem) == "windows" { + if metric.GetTag(ci.OperatingSystem) == ci.OperatingSystemWindows { tagMetricSourceWindows(metric) return } diff --git a/receiver/awscontainerinsightreceiver/internal/stores/utils_test.go b/receiver/awscontainerinsightreceiver/internal/stores/utils_test.go index 714e83b0872f..9bdb74a42445 100644 --- a/receiver/awscontainerinsightreceiver/internal/stores/utils_test.go +++ b/receiver/awscontainerinsightreceiver/internal/stores/utils_test.go @@ -233,7 +233,7 @@ func TestUtils_TagMetricSourceWindows(t *testing.T) { for i, mtype := range types { tags := map[string]string{ ci.MetricType: mtype, - ci.OperatingSystem: "windows", + ci.OperatingSystem: ci.OperatingSystemWindows, } metric := &mockCIMetric{