Skip to content

Commit 50f93df

Browse files
committed
polish review
Signed-off-by: Jared Tan <[email protected]>
1 parent 1ec86c6 commit 50f93df

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

cmd/esmapping-generator/app/flags.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const (
4444

4545
// AddFlags adds flags for esmapping-generator main program
4646
func (o *Options) AddFlags(command *cobra.Command) {
47-
var deprecatedNumShards, deprecatedReplicaShards int64
47+
var deprecatedOptions config.IndexOptions
4848
command.Flags().StringVar(
4949
&o.Mapping,
5050
mappingFlag,
@@ -56,12 +56,12 @@ func (o *Options) AddFlags(command *cobra.Command) {
5656
7,
5757
"The major Elasticsearch version")
5858
command.Flags().Int64Var(
59-
&deprecatedNumShards,
59+
&deprecatedOptions.TemplateNumShards,
6060
shardsFlag,
6161
5,
6262
"(deprecated, will be replaced with num-shards-span,num-shards-service,num-shards-sampling,num-shards-dependencies, if .num-shards set, it will be used as global settings for span,service,sampling,dependencies index) The number of shards per index in Elasticsearch")
6363
command.Flags().Int64Var(
64-
&deprecatedReplicaShards,
64+
&deprecatedOptions.TemplateNumReplicas,
6565
replicasFlag,
6666
1,
6767
"(deprecated, will be replaced with num-replicas-span,num-replicas-service,num-replicas-sampling,num-replicas-dependencies, if .num-replicas set, it will be used as global settings for span,service,sampling,dependencies index) The number of replicas per index in Elasticsearch")
@@ -122,20 +122,20 @@ func (o *Options) AddFlags(command *cobra.Command) {
122122
"jaeger-ilm-policy",
123123
"The name of the ILM policy to use if ILM is active")
124124

125-
if deprecatedNumShards > 0 {
125+
if deprecatedOptions.TemplateNumShards > 0 {
126126
log.Printf("using deprecated %s", shardsFlag)
127-
o.Indices.Spans.TemplateNumShards = deprecatedNumShards
128-
o.Indices.Services.TemplateNumShards = deprecatedNumShards
129-
o.Indices.Dependencies.TemplateNumShards = deprecatedNumShards
130-
o.Indices.Sampling.TemplateNumShards = deprecatedNumShards
127+
o.Indices.Spans.TemplateNumShards = deprecatedOptions.TemplateNumShards
128+
o.Indices.Services.TemplateNumShards = deprecatedOptions.TemplateNumShards
129+
o.Indices.Dependencies.TemplateNumShards = deprecatedOptions.TemplateNumShards
130+
o.Indices.Sampling.TemplateNumShards = deprecatedOptions.TemplateNumShards
131131
}
132132

133-
if deprecatedReplicaShards > 0 {
133+
if deprecatedOptions.TemplateNumReplicas > 0 {
134134
log.Printf("using deprecated %s", replicasFlag)
135-
o.Indices.Spans.TemplateNumReplicas = deprecatedReplicaShards
136-
o.Indices.Services.TemplateNumReplicas = deprecatedReplicaShards
137-
o.Indices.Dependencies.TemplateNumReplicas = deprecatedReplicaShards
138-
o.Indices.Sampling.TemplateNumReplicas = deprecatedReplicaShards
135+
o.Indices.Spans.TemplateNumReplicas = deprecatedOptions.TemplateNumReplicas
136+
o.Indices.Services.TemplateNumReplicas = deprecatedOptions.TemplateNumReplicas
137+
o.Indices.Dependencies.TemplateNumReplicas = deprecatedOptions.TemplateNumReplicas
138+
o.Indices.Sampling.TemplateNumReplicas = deprecatedOptions.TemplateNumReplicas
139139
}
140140

141141
// mark mapping flag as mandatory

0 commit comments

Comments
 (0)