diff --git a/charts/k8s-metacollector/CHANGELOG.md b/charts/k8s-metacollector/CHANGELOG.md index 93176a16c..f8e36eac4 100644 --- a/charts/k8s-metacollector/CHANGELOG.md +++ b/charts/k8s-metacollector/CHANGELOG.md @@ -4,6 +4,12 @@ This file documents all notable changes to `k8s-metacollector` Helm Chart. The release numbering uses [semantic versioning](http://semver.org). +## v0.1.2 + +### Major Changes + +* Update unit tests; + ## v0.1.1 ### Major Changes diff --git a/charts/k8s-metacollector/Chart.yaml b/charts/k8s-metacollector/Chart.yaml index fc7880200..7dde83f05 100644 --- a/charts/k8s-metacollector/Chart.yaml +++ b/charts/k8s-metacollector/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/k8s-metacollector/tests/unit/chartInfo.go b/charts/k8s-metacollector/tests/unit/chartInfo.go index 8f518ace3..33aaed2bb 100644 --- a/charts/k8s-metacollector/tests/unit/chartInfo.go +++ b/charts/k8s-metacollector/tests/unit/chartInfo.go @@ -6,13 +6,13 @@ import ( "testing" ) -func chartInfo(t *testing.T, chartPath string) (map[string]string, error) { +func chartInfo(t *testing.T, chartPath string) (map[string]interface{}, error) { // Get chart info. output, err := helm.RunHelmCommandAndGetOutputE(t, &helm.Options{}, "show", "chart", chartPath) if err != nil { return nil, err } - chartInfo := map[string]string{} + chartInfo := map[string]interface{}{} err = yaml.Unmarshal([]byte(output), &chartInfo) return chartInfo, err } diff --git a/charts/k8s-metacollector/tests/unit/commonMetaFields_test.go b/charts/k8s-metacollector/tests/unit/commonMetaFields_test.go index 385033d42..7d5352d39 100644 --- a/charts/k8s-metacollector/tests/unit/commonMetaFields_test.go +++ b/charts/k8s-metacollector/tests/unit/commonMetaFields_test.go @@ -170,17 +170,19 @@ func (s *commonMetaFieldsTest) TestLabels() { // Get app version. appVersion, found := cInfo["appVersion"] s.True(found, "should find app version in chart info") + appVersion = appVersion.(string) // Get chart version. chartVersion, found := cInfo["version"] s.True(found, "should find chart version in chart info") // Get chart name. chartName, found := cInfo["name"] s.True(found, "should find chart name in chart info") + chartName = chartName.(string) expectedLabels := map[string]string{ "helm.sh/chart": fmt.Sprintf("%s-%s", chartName, chartVersion), - "app.kubernetes.io/name": chartName, + "app.kubernetes.io/name": chartName.(string), "app.kubernetes.io/instance": s.releaseName, - "app.kubernetes.io/version": appVersion, + "app.kubernetes.io/version": appVersion.(string), "app.kubernetes.io/managed-by": "Helm", "app.kubernetes.io/component": "metadata-collector", } diff --git a/charts/k8s-metacollector/tests/unit/deploymentTemplate_test.go b/charts/k8s-metacollector/tests/unit/deploymentTemplate_test.go index 8c4ca0db3..3e9cc235b 100644 --- a/charts/k8s-metacollector/tests/unit/deploymentTemplate_test.go +++ b/charts/k8s-metacollector/tests/unit/deploymentTemplate_test.go @@ -67,14 +67,14 @@ func (s *deploymentTemplateTest) TestImage() { map[string]string{ "image.repository": "falcosecurity/testingRepository", }, - "docker.io/falcosecurity/testingRepository:0.0.0", + fmt.Sprintf("docker.io/falcosecurity/testingRepository:%s", appVersion), }, { "changingImageRegistry", map[string]string{ "image.registry": "ghcr.io", }, - "ghcr.io/falcosecurity/k8s-metacollector:0.0.0", + fmt.Sprintf("ghcr.io/falcosecurity/k8s-metacollector:%s", appVersion), }, { "changingAllImageFields",