Skip to content
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

Enable completion time-to-live to be set on all jobs #407

Merged
merged 4 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBT
github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=
Copy link
Contributor Author

@objectiser objectiser Jun 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpkrohling Would you expect these changes to the go.sum file? They seem similar except next line as /go.mod

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, but the version seems strange. Perhaps it's pointing to master and they had a new commit recently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would have expected it to just update the existing line rather than add a new.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good point. I need to understand go modules better in order to answer that. I have seen duplicated entries in different sections in the go.mod, but not sure I would expect the same for go.sum...

github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/prometheus-operator v0.26.0 h1:QPhC10DLDS79SahPAEgDOfyt/bWm0vfebeF3nXQdU7w=
Expand Down Expand Up @@ -104,6 +105,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff h1:kOkM9whyQYodu09SJ6W3NCsHG7crFaJILQ22Gozp3lg=
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -206,6 +208,7 @@ github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/openshift/api v0.0.0-20180830153656-5ad8479f64f1 h1:QFa2pD3fP3TZ7cvxBWs8H46rafOJxDStr96saiufmxI=
github.com/openshift/api v0.0.0-20180830153656-5ad8479f64f1/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY=
github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg=
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
Expand All @@ -224,6 +227,7 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
Expand Down Expand Up @@ -289,6 +293,7 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd
github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
Expand All @@ -308,6 +313,7 @@ github.com/uber-go/atomic v1.4.0 h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o=
github.com/uber-go/atomic v1.4.0/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
github.com/uber/jaeger-client-go v2.15.0+incompatible h1:NP3qsSqNxh8VYr956ur1N/1C1PjvOJnJykCzcD5QHbk=
github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v1.5.0 h1:OHbgr8l656Ub3Fw5k9SWnBfIEwvoHQ+W2y+Aa9D1Uyo=
github.com/uber/jaeger-lib v1.5.0/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
Expand Down
26 changes: 15 additions & 11 deletions pkg/apis/jaegertracing/v1/jaeger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ type ElasticsearchSpec struct {
// JaegerCassandraCreateSchemaSpec holds the options related to the create-schema batch job
// +k8s:openapi-gen=true
type JaegerCassandraCreateSchemaSpec struct {
Enabled *bool `json:"enabled"`
Image string `json:"image"`
Datacenter string `json:"datacenter"`
Mode string `json:"mode"`
Enabled *bool `json:"enabled"`
Image string `json:"image"`
Datacenter string `json:"datacenter"`
Mode string `json:"mode"`
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished"`
}

// JaegerDependenciesSpec defined options for running spark-dependencies.
Expand All @@ -218,22 +219,25 @@ type JaegerDependenciesSpec struct {
CassandraClientAuthEnabled bool `json:"cassandraClientAuthEnabled"`
ElasticsearchClientNodeOnly bool `json:"elasticsearchClientNodeOnly"`
ElasticsearchNodesWanOnly bool `json:"elasticsearchNodesWanOnly"`
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished"`
}

// JaegerEsIndexCleanerSpec holds the options related to es-index-cleaner
// +k8s:openapi-gen=true
type JaegerEsIndexCleanerSpec struct {
Enabled *bool `json:"enabled"`
NumberOfDays *int `json:"numberOfDays"`
Schedule string `json:"schedule"`
Image string `json:"image"`
Enabled *bool `json:"enabled"`
NumberOfDays *int `json:"numberOfDays"`
Schedule string `json:"schedule"`
Image string `json:"image"`
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished"`
}

// JaegerEsRolloverSpec holds the options related to es-rollover
type JaegerEsRolloverSpec struct {
Image string `json:"image"`
Schedule string `json:"schedule"`
Conditions string `json:"conditions"`
Image string `json:"image"`
Schedule string `json:"schedule"`
Conditions string `json:"conditions"`
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished"`
// we parse it with time.ParseDuration
ReadTTL string `json:"readTTL"`
}
Expand Down
22 changes: 21 additions & 1 deletion pkg/apis/jaegertracing/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/cronjob/es_index_cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ func CreateEsIndexCleaner(jaeger *v1.Jaeger) *batchv1beta1.CronJob {
Schedule: jaeger.Spec.Storage.EsIndexCleaner.Schedule,
JobTemplate: batchv1beta1.JobTemplateSpec{
Spec: batchv1.JobSpec{
Parallelism: &one,
Parallelism: &one,
TTLSecondsAfterFinished: jaeger.Spec.Storage.EsIndexCleaner.TTLSecondsAfterFinished,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
Expand Down
3 changes: 3 additions & 0 deletions pkg/cronjob/es_index_cleaner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ func TestCreateEsIndexCleaner(t *testing.T) {
map[string]interface{}{"es.index-prefix": "tenant1", "es.server-urls": "http://nowhere:666,foo"})}}}
days := 0
jaeger.Spec.Storage.EsIndexCleaner.NumberOfDays = &days
ttlSecondsAfterFinished := int32(100)
jaeger.Spec.Storage.EsIndexCleaner.TTLSecondsAfterFinished = &ttlSecondsAfterFinished
cronJob := CreateEsIndexCleaner(jaeger)
assert.Equal(t, ttlSecondsAfterFinished, *cronJob.Spec.JobTemplate.Spec.TTLSecondsAfterFinished)
assert.Equal(t, 2, len(cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Args))
// default number of days (7) is applied in normalize in controller
assert.Equal(t, []string{"0", "http://nowhere:666"}, cronJob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Args)
Expand Down
6 changes: 2 additions & 4 deletions pkg/cronjob/es_rollover.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func rollover(jaeger *v1.Jaeger) batchv1beta1.CronJob {
envs = append(envs, corev1.EnvVar{Name: "CONDITIONS", Value: jaeger.Spec.Storage.Rollover.Conditions})
}
one := int32(1)
ttlHourInSec := int32(60 * 60)
return batchv1beta1.CronJob{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand All @@ -48,7 +47,7 @@ func rollover(jaeger *v1.Jaeger) batchv1beta1.CronJob {
Schedule: jaeger.Spec.Storage.Rollover.Schedule,
JobTemplate: batchv1beta1.JobTemplateSpec{
Spec: batchv1.JobSpec{
TTLSecondsAfterFinished: &ttlHourInSec,
TTLSecondsAfterFinished: jaeger.Spec.Storage.Rollover.TTLSecondsAfterFinished,
Parallelism: &one,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -91,7 +90,6 @@ func lookback(jaeger *v1.Jaeger) batchv1beta1.CronJob {
Error("Failed to parse esRollover.readTTL to time.duration")
}
}
ttlHourInSec := int32(60 * 60)
return batchv1beta1.CronJob{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand All @@ -104,7 +102,7 @@ func lookback(jaeger *v1.Jaeger) batchv1beta1.CronJob {
Schedule: jaeger.Spec.Storage.Rollover.Schedule,
JobTemplate: batchv1beta1.JobTemplateSpec{
Spec: batchv1.JobSpec{
TTLSecondsAfterFinished: &ttlHourInSec,
TTLSecondsAfterFinished: jaeger.Spec.Storage.Rollover.TTLSecondsAfterFinished,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
Expand Down
6 changes: 6 additions & 0 deletions pkg/cronjob/es_rollover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func TestRollover(t *testing.T) {
j.Spec.Storage.Rollover.Image = "wohooo"
j.Spec.Storage.Rollover.Conditions = "weheee"
j.Spec.Storage.Options = v1.NewOptions(map[string]interface{}{"es.server-urls": "foo,bar", "es.index-prefix": "shortone"})
ttlSecondsAfterFinished := int32(100)
j.Spec.Storage.Rollover.TTLSecondsAfterFinished = &ttlSecondsAfterFinished

cjob := rollover(j)
assert.Equal(t, j.Namespace, cjob.Namespace)
Expand All @@ -32,6 +34,7 @@ func TestRollover(t *testing.T) {
assert.Equal(t, j.Spec.Storage.Rollover.Image, cjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image)
assert.Equal(t, []string{"rollover", "foo"}, cjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Args)
assert.Equal(t, []corev1.EnvVar{{Name: "INDEX_PREFIX", Value: "shortone"}, {Name: "CONDITIONS", Value: "weheee"}}, cjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Env)
assert.Equal(t, ttlSecondsAfterFinished, *cjob.Spec.JobTemplate.Spec.TTLSecondsAfterFinished)
}

func TestLookback(t *testing.T) {
Expand All @@ -40,6 +43,8 @@ func TestLookback(t *testing.T) {
j.Spec.Storage.Rollover.Image = "wohooo"
j.Spec.Storage.Rollover.ReadTTL = "2h"
j.Spec.Storage.Options = v1.NewOptions(map[string]interface{}{"es.server-urls": "foo,bar", "es.index-prefix": "shortone"})
ttlSecondsAfterFinished := int32(100)
j.Spec.Storage.Rollover.TTLSecondsAfterFinished = &ttlSecondsAfterFinished

cjob := lookback(j)
assert.Equal(t, j.Namespace, cjob.Namespace)
Expand All @@ -49,6 +54,7 @@ func TestLookback(t *testing.T) {
assert.Equal(t, j.Spec.Storage.Rollover.Image, cjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Image)
assert.Equal(t, []string{"lookback", "foo"}, cjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Args)
assert.Equal(t, []corev1.EnvVar{{Name: "INDEX_PREFIX", Value: "shortone"}, {Name: "UNIT", Value: "hours"}, {Name: "UNIT_COUNT", Value: "2"}}, cjob.Spec.JobTemplate.Spec.Template.Spec.Containers[0].Env)
assert.Equal(t, ttlSecondsAfterFinished, *cjob.Spec.JobTemplate.Spec.TTLSecondsAfterFinished)
}

func TestEnvVars(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/cronjob/spark_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func CreateSparkDependencies(jaeger *v1.Jaeger) *batchv1beta1.CronJob {
Schedule: jaeger.Spec.Storage.SparkDependencies.Schedule,
JobTemplate: batchv1beta1.JobTemplateSpec{
Spec: batchv1.JobSpec{
Parallelism: &one,
Parallelism: &one,
TTLSecondsAfterFinished: jaeger.Spec.Storage.SparkDependencies.TTLSecondsAfterFinished,
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
Expand Down
10 changes: 10 additions & 0 deletions pkg/cronjob/spark_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@ func TestStorageEnvs(t *testing.T) {
func TestCreate(t *testing.T) {
assert.NotNil(t, CreateSparkDependencies(&v1.Jaeger{Spec: v1.JaegerSpec{Storage: v1.JaegerStorageSpec{Type: "elasticsearch"}}}))
}

func TestSparkDependencies(t *testing.T) {
j := &v1.Jaeger{Spec: v1.JaegerSpec{Storage: v1.JaegerStorageSpec{Type: "elasticsearch"}}}
ttlSecondsAfterFinished := int32(100)
j.Spec.Storage.SparkDependencies.TTLSecondsAfterFinished = &ttlSecondsAfterFinished

cjob := CreateSparkDependencies(j)
assert.Equal(t, j.Namespace, cjob.Namespace)
assert.Equal(t, ttlSecondsAfterFinished, *cjob.Spec.JobTemplate.Spec.TTLSecondsAfterFinished)
}
3 changes: 2 additions & 1 deletion pkg/storage/cassandra_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func cassandraDeps(jaeger *v1.Jaeger) []batchv1.Job {
},
},
Spec: batchv1.JobSpec{
ActiveDeadlineSeconds: &deadline,
ActiveDeadlineSeconds: &deadline,
TTLSecondsAfterFinished: jaeger.Spec.Storage.CassandraCreateSchema.TTLSecondsAfterFinished,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Annotations: annotations,
Expand Down
11 changes: 11 additions & 0 deletions pkg/storage/cassandra_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,14 @@ func TestCassandraCreateSchemaEnabledNil(t *testing.T) {
assert.Nil(t, jaeger.Spec.Storage.CassandraCreateSchema.Enabled)
assert.Len(t, cassandraDeps(jaeger), 1)
}

func TestCassandraCreateSchemaTTLSecondsAfterFinished(t *testing.T) {
trueVar := true

jaeger := v1.NewJaeger("TestCassandraCreateSchemaTTLSecondsAfterFinished")
jaeger.Spec.Storage.CassandraCreateSchema.Enabled = &trueVar
ttlSecondsAfterFinished := int32(100)
jaeger.Spec.Storage.CassandraCreateSchema.TTLSecondsAfterFinished = &ttlSecondsAfterFinished
cjob := cassandraDeps(jaeger)
assert.Equal(t, ttlSecondsAfterFinished, *cjob[0].Spec.TTLSecondsAfterFinished)
}
21 changes: 21 additions & 0 deletions pkg/strategy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const (
esCertGenerationScript = "./scripts/cert_generation.sh"
)

var (
// Default to 1 day
defTTLSecondsAfterFinished = int32(86400)
)

// For returns the appropriate Strategy for the given Jaeger instance
func For(ctx context.Context, jaeger *v1.Jaeger, secrets []corev1.Secret) S {
if strings.EqualFold(jaeger.Spec.Strategy, "all-in-one") {
Expand Down Expand Up @@ -90,6 +95,7 @@ func normalize(jaeger *v1.Jaeger) {
normalizeIndexCleaner(&jaeger.Spec.Storage.EsIndexCleaner, jaeger.Spec.Storage.Type)
normalizeElasticsearch(&jaeger.Spec.Storage.Elasticsearch)
normalizeRollover(&jaeger.Spec.Storage.Rollover)
normalizeCassandraCreateSchema(&jaeger.Spec.Storage.CassandraCreateSchema)
normalizeUI(&jaeger.Spec)
}

Expand All @@ -107,6 +113,9 @@ func normalizeSparkDependencies(spec *v1.JaegerStorageSpec) {
if spec.SparkDependencies.Schedule == "" {
spec.SparkDependencies.Schedule = "55 23 * * *"
}
if spec.SparkDependencies.TTLSecondsAfterFinished == nil {
spec.SparkDependencies.TTLSecondsAfterFinished = &defTTLSecondsAfterFinished
}
}

func normalizeIndexCleaner(spec *v1.JaegerEsIndexCleanerSpec, storage string) {
Expand All @@ -125,6 +134,9 @@ func normalizeIndexCleaner(spec *v1.JaegerEsIndexCleanerSpec, storage string) {
defDays := 7
spec.NumberOfDays = &defDays
}
if spec.TTLSecondsAfterFinished == nil {
spec.TTLSecondsAfterFinished = &defTTLSecondsAfterFinished
}
}

func normalizeElasticsearch(spec *v1.ElasticsearchSpec) {
Expand All @@ -140,6 +152,15 @@ func normalizeRollover(spec *v1.JaegerEsRolloverSpec) {
if spec.Schedule == "" {
spec.Schedule = "*/30 * * * *"
}
if spec.TTLSecondsAfterFinished == nil {
spec.TTLSecondsAfterFinished = &defTTLSecondsAfterFinished
}
}

func normalizeCassandraCreateSchema(spec *v1.JaegerCassandraCreateSchemaSpec) {
if spec.TTLSecondsAfterFinished == nil {
spec.TTLSecondsAfterFinished = &defTTLSecondsAfterFinished
}
}

func normalizeUI(spec *v1.JaegerSpec) {
Expand Down
Loading