Skip to content

Commit

Permalink
Use to lower
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay committed Dec 7, 2018
1 parent e80fd5c commit f0279e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/cronjob/spark_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cronjob
import (
"fmt"
"strconv"
"strings"

batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
Expand All @@ -16,7 +17,7 @@ import (
var supportedStorageTypes = map[string]bool{"elasticsearch": true, "cassandra": true}

func SupportedStorage(storage string) bool {
return supportedStorageTypes[storage]
return supportedStorageTypes[strings.ToLower(storage)]
}

func CreateSparkDependencies(jaeger *v1alpha1.Jaeger) *batchv1beta1.CronJob {
Expand Down
3 changes: 2 additions & 1 deletion pkg/strategy/all-in-one.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package strategy

import (
"context"
"strings"

"github.com/sirupsen/logrus"
"github.com/spf13/viper"
Expand Down Expand Up @@ -88,7 +89,7 @@ func (c *allInOneStrategy) Create() []runtime.Object {
}

if isBoolTrue(c.jaeger.Spec.Storage.EsIndexCleaner.Enabled) {
if c.jaeger.Spec.Storage.Type == "elasticsearch" {
if strings.ToLower(c.jaeger.Spec.Storage.Type) == "elasticsearch" {
os = append(os, cronjob.CreateEsIndexCleaner(c.jaeger))
} else {
logrus.WithField("type", c.jaeger.Spec.Storage.Type).Warn("Elasticsearch index cleaner is enabled for unsupported storage")
Expand Down
3 changes: 2 additions & 1 deletion pkg/strategy/production.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package strategy

import (
"context"
"strings"

"github.com/sirupsen/logrus"
"github.com/spf13/viper"
Expand Down Expand Up @@ -94,7 +95,7 @@ func (c *productionStrategy) Create() []runtime.Object {
}

if isBoolTrue(c.jaeger.Spec.Storage.EsIndexCleaner.Enabled) {
if c.jaeger.Spec.Storage.Type == "elasticsearch" {
if strings.ToLower(c.jaeger.Spec.Storage.Type) == "elasticsearch" {
os = append(os, cronjob.CreateEsIndexCleaner(c.jaeger))
} else {
logrus.WithField("type", c.jaeger.Spec.Storage.Type).Warn("Elasticsearch index cleaner is enabled for unsupported storage")
Expand Down

0 comments on commit f0279e0

Please sign in to comment.