-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New DeploymentStrategy type for JaegerSpec.Strategy #704
Changes from 5 commits
4dcf62a
5e43380
5843126
cafa6ce
0a29840
a8850d6
ae31e2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ import ( | |
"fmt" | ||
"sort" | ||
"strconv" | ||
"strings" | ||
|
||
"github.com/spf13/viper" | ||
appsv1 "k8s.io/api/apps/v1" | ||
|
@@ -76,9 +75,9 @@ func (c *Collector) Get() *appsv1.Deployment { | |
} | ||
|
||
storageType := c.jaeger.Spec.Storage.Type | ||
// If strategy is "streaming", then change storage type | ||
// If strategy is DeploymentStrategyStreaming, then change storage type | ||
// to Kafka, and the storage options will be used in the Ingester instead | ||
if strings.EqualFold(c.jaeger.Spec.Strategy, "streaming") { | ||
if c.jaeger.Spec.Strategy == v1.DeploymentStrategyStreaming { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would happen if we have a CR with a strategy set to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was assuming that the value was being normalized somewhere else. Sorry, my bad. |
||
storageType = "kafka" | ||
} | ||
options := allArgs(c.jaeger.Spec.Collector.Options, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,13 @@ import ( | |
"k8s.io/api/extensions/v1beta1" | ||
rbac "k8s.io/api/rbac/v1" | ||
|
||
jv1 "github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We typically use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes a lot of sense! I saw that |
||
esv1 "github.com/jaegertracing/jaeger-operator/pkg/storage/elasticsearch/v1" | ||
) | ||
|
||
// S knows what type of deployments to build based on a given spec | ||
type S struct { | ||
typ Type | ||
typ jv1.DeploymentStrategy | ||
accounts []v1.ServiceAccount | ||
configMaps []v1.ConfigMap | ||
cronJobs []batchv1beta1.CronJob | ||
|
@@ -29,28 +30,13 @@ type S struct { | |
secrets []v1.Secret | ||
} | ||
|
||
// Type represents a specific deployment strategy, like 'all-in-one' | ||
type Type string | ||
|
||
const ( | ||
|
||
// AllInOne represents the 'all-in-one' deployment strategy | ||
AllInOne Type = "allInOne" | ||
|
||
// Production represents the 'production' deployment strategy | ||
Production Type = "production" | ||
|
||
// Streaming represents the 'streaming' deployment strategy | ||
Streaming Type = "streaming" | ||
) | ||
|
||
// New constructs a new strategy from scratch | ||
func New() *S { | ||
return &S{} | ||
} | ||
|
||
// Type returns the strategy type for the given strategy | ||
func (s S) Type() Type { | ||
func (s S) Type() jv1.DeploymentStrategy { | ||
return s.typ | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could implement the UnmarshalJSON method to the type, to ensure the values read from JSON are converted to lowercase.