From 9502d95978842ccd4d1943443e2672a2f9f59084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Wed, 7 Oct 2020 09:55:58 +0200 Subject: [PATCH] Fix options tests --- processor/k8sprocessor/options_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/processor/k8sprocessor/options_test.go b/processor/k8sprocessor/options_test.go index d0e4e9f03076..73f00fcfa8d6 100644 --- a/processor/k8sprocessor/options_test.go +++ b/processor/k8sprocessor/options_test.go @@ -198,6 +198,7 @@ func TestWithExtractLabels(t *testing.T) { func TestWithExtractMetadata(t *testing.T) { p := &kubernetesprocessor{} assert.NoError(t, WithExtractMetadata()(p)) + // Default assert.True(t, p.rules.Namespace) assert.True(t, p.rules.PodName) assert.True(t, p.rules.PodUID) @@ -205,8 +206,9 @@ func TestWithExtractMetadata(t *testing.T) { assert.True(t, p.rules.Deployment) assert.True(t, p.rules.Cluster) assert.True(t, p.rules.Node) - assert.True(t, p.rules.HostName) - assert.True(t, p.rules.ContainerName) + // Optional + assert.False(t, p.rules.HostName) + assert.False(t, p.rules.ContainerName) p = &kubernetesprocessor{} err := WithExtractMetadata("randomfield")(p)