Skip to content

Commit

Permalink
Merge branch 'bug_6497'
Browse files Browse the repository at this point in the history
  • Loading branch information
skirtan1 committed Jan 8, 2025
2 parents df8900a + 2a808ca commit bdf310d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions cmd/es-index-cleaner/app/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const (
archive = "archive"
rollover = "rollover"
timeout = "timeout"
ignoreUnavailable = "ignore-unavailable"
indexDateSeparator = "index-date-separator"
username = "es.username"
password = "es.password"
Expand All @@ -31,7 +30,6 @@ type Config struct {
Archive bool
Rollover bool
MasterNodeTimeoutSeconds int
IgnoreUnavailableIndex bool
IndexDateSeparator string
Username string
Password string
Expand All @@ -45,7 +43,6 @@ func (*Config) AddFlags(flags *flag.FlagSet) {
flags.Bool(archive, false, "Whether to remove archive indices. It works only for rollover")
flags.Bool(rollover, false, "Whether to remove indices created by rollover")
flags.Int(timeout, 120, "Number of seconds to wait for master node response")
flags.Bool(ignoreUnavailable, true, "If false, returns an error when index is missing")
flags.String(indexDateSeparator, "-", "Index date separator")
flags.String(username, "", "The username required by storage")
flags.String(password, "", "The password required by storage")
Expand All @@ -62,7 +59,6 @@ func (c *Config) InitFromViper(v *viper.Viper) {
c.Archive = v.GetBool(archive)
c.Rollover = v.GetBool(rollover)
c.MasterNodeTimeoutSeconds = v.GetInt(timeout)
c.IgnoreUnavailableIndex = v.GetBool(ignoreUnavailable)
c.IndexDateSeparator = v.GetString(indexDateSeparator)
c.Username = v.GetString(username)
c.Password = v.GetString(password)
Expand Down
2 changes: 0 additions & 2 deletions cmd/es-index-cleaner/app/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func TestBindFlags(t *testing.T) {
"--rollover=true",
"--archive=true",
"--timeout=150",
"--ignore-unavailable=false",
"--index-date-separator=@",
"--es.username=admin",
"--es.password=admin",
Expand All @@ -39,7 +38,6 @@ func TestBindFlags(t *testing.T) {
assert.True(t, c.Rollover)
assert.True(t, c.Archive)
assert.Equal(t, 150, c.MasterNodeTimeoutSeconds)
assert.False(t, c.IgnoreUnavailableIndex)
assert.Equal(t, "@", c.IndexDateSeparator)
assert.Equal(t, "admin", c.Username)
assert.Equal(t, "admin", c.Password)
Expand Down
2 changes: 1 addition & 1 deletion cmd/es-index-cleaner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main() {
BasicAuth: basicAuth(cfg.Username, cfg.Password),
},
MasterTimeoutSeconds: cfg.MasterNodeTimeoutSeconds,
IgnoreUnavailableIndex: cfg.IgnoreUnavailableIndex,
IgnoreUnavailableIndex: true,
}

indices, err := i.GetJaegerIndices(cfg.IndexPrefix)
Expand Down

0 comments on commit bdf310d

Please sign in to comment.