From 2785eef683afeb387daa447dc16fbab669149243 Mon Sep 17 00:00:00 2001 From: Shubhanshu Surana Date: Mon, 4 Nov 2019 10:09:35 -0800 Subject: [PATCH] updated jaeger spec strategy to use constant instead of string Signed-off-by: Shubhanshu Surana Signed-off-by: Shubhanshu Surana --- pkg/config/sampling/sampling.go | 2 +- pkg/config/sampling/sampling_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/sampling/sampling.go b/pkg/config/sampling/sampling.go index 12ab0d678..5d1d90630 100644 --- a/pkg/config/sampling/sampling.go +++ b/pkg/config/sampling/sampling.go @@ -88,7 +88,7 @@ func CheckForSamplingConfigFile(jaeger *v1.Jaeger) bool { options := v1.Options{} // check for deployment strategy - if jaeger.Spec.Strategy == "allInOne" { + if jaeger.Spec.Strategy == v1.DeploymentStrategyAllInOne { options = jaeger.Spec.AllInOne.Options } else { options = jaeger.Spec.Collector.Options diff --git a/pkg/config/sampling/sampling_test.go b/pkg/config/sampling/sampling_test.go index 38041d834..ea8df0182 100644 --- a/pkg/config/sampling/sampling_test.go +++ b/pkg/config/sampling/sampling_test.go @@ -83,7 +83,7 @@ func TestUpdateWithSamplingConfig(t *testing.T) { func TestUpdateWithSamplingConfigFileOption(t *testing.T) { jaeger := v1.NewJaeger(types.NamespacedName{Name: "TestUpdateWithSamplingConfigFileOption"}) - jaeger.Spec.Strategy = "allInOne" + jaeger.Spec.Strategy = v1.DeploymentStrategyAllInOne jaeger.Spec.AllInOne.Options = v1.NewOptions(map[string]interface{}{ "sampling.strategies-file": "/etc/jaeger/sampling.json", })