diff --git a/cmd/es-rollover/app/actions_test.go b/cmd/es-rollover/app/actions_test.go index 50039f6e71cc..c3208de8dfc5 100644 --- a/cmd/es-rollover/app/actions_test.go +++ b/cmd/es-rollover/app/actions_test.go @@ -78,7 +78,7 @@ func TestExecuteAction(t *testing.T) { configError: true, }, } - logger, _ := zap.NewProduction() + logger := zap.NewNop() args := []string{ "https://localhost:9300", } diff --git a/cmd/es-rollover/app/flags.go b/cmd/es-rollover/app/flags.go index 0f4603e2517a..f1b9664d51e4 100644 --- a/cmd/es-rollover/app/flags.go +++ b/cmd/es-rollover/app/flags.go @@ -63,5 +63,4 @@ func (c *Config) InitFromViper(v *viper.Viper) { c.ILMPolicyName = v.GetString(ilmPolicyName) c.UseILM = v.GetBool(useILM) c.Timeout = v.GetInt(timeout) - } diff --git a/cmd/es-rollover/app/flags_test.go b/cmd/es-rollover/app/flags_test.go index ded036b20641..1b449f0006c4 100644 --- a/cmd/es-rollover/app/flags_test.go +++ b/cmd/es-rollover/app/flags_test.go @@ -51,5 +51,4 @@ func TestBindFlags(t *testing.T) { assert.Equal(t, "admin", c.Username) assert.Equal(t, "qwerty123", c.Password) assert.Equal(t, "jaeger-ilm", c.ILMPolicyName) - } diff --git a/cmd/es-rollover/app/index_options.go b/cmd/es-rollover/app/index_options.go index 52585c8819b0..5baee5269bb7 100644 --- a/cmd/es-rollover/app/index_options.go +++ b/cmd/es-rollover/app/index_options.go @@ -49,7 +49,6 @@ func RolloverIndices(archive bool, prefix string) []IndexOption { TemplateName: strings.TrimLeft(fmt.Sprintf("%s-jaeger-service", prefix), "-"), }, } - } // ReadAliasName returns read alias name of the index diff --git a/cmd/es-rollover/app/index_options_test.go b/cmd/es-rollover/app/index_options_test.go index 46569768ee21..ec263396e8f2 100644 --- a/cmd/es-rollover/app/index_options_test.go +++ b/cmd/es-rollover/app/index_options_test.go @@ -116,5 +116,4 @@ func TestRolloverIndices(t *testing.T) { } }) } - } diff --git a/cmd/es-rollover/app/init/action.go b/cmd/es-rollover/app/init/action.go index aaf73d4bb401..c4603a10b55f 100644 --- a/cmd/es-rollover/app/init/action.go +++ b/cmd/es-rollover/app/init/action.go @@ -40,8 +40,8 @@ type Action struct { func (c Action) getMapping(version uint, templateName string) (string, error) { mappingBuilder := mappings.MappingBuilder{ TemplateBuilder: es.TextTemplateBuilder{}, - Shards: c.Config.Shards, - Replicas: c.Config.Replicas, + Shards: int64(c.Config.Shards), + Replicas: int64(c.Config.Replicas), IndexPrefix: c.Config.IndexPrefix, UseILM: c.Config.UseILM, ILMPolicyName: c.Config.ILMPolicyName, diff --git a/cmd/es-rollover/app/init/action_test.go b/cmd/es-rollover/app/init/action_test.go index 794f21744fe8..ca708c29be51 100644 --- a/cmd/es-rollover/app/init/action_test.go +++ b/cmd/es-rollover/app/init/action_test.go @@ -85,7 +85,6 @@ func TestIndexCreateIfNotExist(t *testing.T) { } }) } - } func TestRolloverAction(t *testing.T) { tests := []struct { diff --git a/cmd/es-rollover/app/init/flags.go b/cmd/es-rollover/app/init/flags.go index 9f93aa9e499b..ae11e487d471 100644 --- a/cmd/es-rollover/app/init/flags.go +++ b/cmd/es-rollover/app/init/flags.go @@ -30,8 +30,8 @@ const ( // Config holds configuration for index cleaner binary. type Config struct { app.Config - Shards int64 - Replicas int64 + Shards int + Replicas int } // AddFlags adds flags for TLS to the FlagSet. @@ -43,6 +43,6 @@ func (c *Config) AddFlags(flags *flag.FlagSet) { // InitFromViper initializes config from viper.Viper. func (c *Config) InitFromViper(v *viper.Viper) { - c.Shards = v.GetInt64(shards) - c.Replicas = v.GetInt64(replicas) + c.Shards = v.GetInt(shards) + c.Replicas = v.GetInt(replicas) } diff --git a/cmd/es-rollover/app/init/flags_test.go b/cmd/es-rollover/app/init/flags_test.go index f412cd036290..483a3ce9690d 100644 --- a/cmd/es-rollover/app/init/flags_test.go +++ b/cmd/es-rollover/app/init/flags_test.go @@ -40,6 +40,6 @@ func TestBindFlags(t *testing.T) { require.NoError(t, err) c.InitFromViper(v) - assert.Equal(t, int64(8), c.Shards) - assert.Equal(t, int64(16), c.Replicas) + assert.Equal(t, 8, c.Shards) + assert.Equal(t, 16, c.Replicas) } diff --git a/cmd/es-rollover/app/lookback/action_test.go b/cmd/es-rollover/app/lookback/action_test.go index 66a54a73780e..c49c4639c9d6 100644 --- a/cmd/es-rollover/app/lookback/action_test.go +++ b/cmd/es-rollover/app/lookback/action_test.go @@ -67,9 +67,11 @@ func TestLookBackAction(t *testing.T) { CreationTime: nowTime, }, } + timeNow = func() time.Time { return nowTime } + tests := []struct { name string setupCallExpectations func(indexClient *mocks.MockIndexAPI) diff --git a/cmd/es-rollover/app/rollover/action_test.go b/cmd/es-rollover/app/rollover/action_test.go index e8724f6d63f4..0376270b95a9 100644 --- a/cmd/es-rollover/app/rollover/action_test.go +++ b/cmd/es-rollover/app/rollover/action_test.go @@ -109,5 +109,4 @@ func TestRolloverAction(t *testing.T) { indexClient.AssertExpectations(t) }) } - }