From 2a808ca8d1fc43585ad9da5daf09b667a371e473 Mon Sep 17 00:00:00 2001 From: Shreyas Kirtane Date: Tue, 7 Jan 2025 21:00:51 -0700 Subject: [PATCH] remove ignore_unavailable flag from es-index-cleaner Signed-off-by: Shreyas Kirtane --- cmd/es-index-cleaner/app/flags.go | 4 ---- cmd/es-index-cleaner/app/flags_test.go | 2 -- cmd/es-index-cleaner/main.go | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/cmd/es-index-cleaner/app/flags.go b/cmd/es-index-cleaner/app/flags.go index 0b3070109b5..d25312bf32d 100644 --- a/cmd/es-index-cleaner/app/flags.go +++ b/cmd/es-index-cleaner/app/flags.go @@ -17,7 +17,6 @@ const ( archive = "archive" rollover = "rollover" timeout = "timeout" - ignoreUnavailable = "ignore-unavailable" indexDateSeparator = "index-date-separator" username = "es.username" password = "es.password" @@ -31,7 +30,6 @@ type Config struct { Archive bool Rollover bool MasterNodeTimeoutSeconds int - IgnoreUnavailableIndex bool IndexDateSeparator string Username string Password string @@ -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") @@ -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) diff --git a/cmd/es-index-cleaner/app/flags_test.go b/cmd/es-index-cleaner/app/flags_test.go index d5b0c4a999a..47f574968c6 100644 --- a/cmd/es-index-cleaner/app/flags_test.go +++ b/cmd/es-index-cleaner/app/flags_test.go @@ -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", @@ -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) diff --git a/cmd/es-index-cleaner/main.go b/cmd/es-index-cleaner/main.go index 42014c79ac1..3c980b2da78 100644 --- a/cmd/es-index-cleaner/main.go +++ b/cmd/es-index-cleaner/main.go @@ -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)