Skip to content

Commit

Permalink
Minor code style changes
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
  • Loading branch information
rubenvp8510 committed Sep 7, 2021
1 parent 18e7296 commit 31c5a4e
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/es-rollover/app/actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestExecuteAction(t *testing.T) {
configError: true,
},
}
logger, _ := zap.NewProduction()
logger := zap.NewNop()
args := []string{
"https://localhost:9300",
}
Expand Down
1 change: 0 additions & 1 deletion cmd/es-rollover/app/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
1 change: 0 additions & 1 deletion cmd/es-rollover/app/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
1 change: 0 additions & 1 deletion cmd/es-rollover/app/index_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion cmd/es-rollover/app/index_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,4 @@ func TestRolloverIndices(t *testing.T) {
}
})
}

}
4 changes: 2 additions & 2 deletions cmd/es-rollover/app/init/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion cmd/es-rollover/app/init/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func TestIndexCreateIfNotExist(t *testing.T) {
}
})
}

}
func TestRolloverAction(t *testing.T) {
tests := []struct {
Expand Down
8 changes: 4 additions & 4 deletions cmd/es-rollover/app/init/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
}
4 changes: 2 additions & 2 deletions cmd/es-rollover/app/init/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 2 additions & 0 deletions cmd/es-rollover/app/lookback/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion cmd/es-rollover/app/rollover/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,4 @@ func TestRolloverAction(t *testing.T) {
indexClient.AssertExpectations(t)
})
}

}
1 change: 1 addition & 0 deletions pkg/es/client/mocks/.nocover
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mocks, no need tests.

0 comments on commit 31c5a4e

Please sign in to comment.