From 37340f79bf115a1626ba0ce085ae5df83c5e66e6 Mon Sep 17 00:00:00 2001 From: Predrag Janosevic Date: Fri, 14 Jun 2024 15:48:24 +0100 Subject: [PATCH 1/2] dbaas opensearch: remove top-level max-index-count flag --- cmd/dbaas_create.go | 1 - cmd/dbaas_create_opensearch.go | 4 ---- cmd/dbaas_show_opensearch.go | 3 --- cmd/dbaas_update.go | 1 - cmd/dbaas_update_opensearch.go | 5 ----- 5 files changed, 14 deletions(-) diff --git a/cmd/dbaas_create.go b/cmd/dbaas_create.go index 02a90f5d..63ed7247 100644 --- a/cmd/dbaas_create.go +++ b/cmd/dbaas_create.go @@ -57,7 +57,6 @@ type dbaasServiceCreateCmd struct { OpensearchIndexTemplateNumberOfShards int64 `cli-flag:"opensearch-index-template-number-of-shards" cli-usage:"The number of primary shards that an index should have." cli-hidden:""` OpensearchIPFilter []string `cli-flag:"opensearch-ip-filter" cli-usage:"Allow incoming connections from CIDR address block" cli-hidden:""` OpensearchKeepIndexRefreshInterval bool `cli-flag:"opensearch-keep-index-refresh-interval" cli-usage:"index.refresh_interval is reset to default value for every index to be sure that indices are always visible to search. Set to true disable this." cli-hidden:""` - OpensearchMaxIndexCount int64 `cli-flag:"opensearch-max-index-count" cli-usage:"Maximum number of indexes to keep before deleting the oldest one" cli-hidden:""` OpensearchDashboardEnabled bool `cli-flag:"opensearch-dashboard-enabled" cli-usage:"Enable or disable OpenSearch Dashboards (default: true)" cli-hidden:""` OpensearchDashboardMaxOldSpaceSize int64 `cli-flag:"opensearch-dashboard-max-old-space-size" cli-usage:"Memory limit in MiB for OpenSearch Dashboards. Note: The memory reserved by OpenSearch Dashboards is not available for OpenSearch. (default: 128)" cli-hidden:""` OpensearchDashboardRequestTimeout int64 `cli-flag:"opensearch-dashboard-request-timeout" cli-usage:"Timeout in milliseconds for requests made by OpenSearch Dashboards towards OpenSearch (default: 30000)" cli-hidden:""` diff --git a/cmd/dbaas_create_opensearch.go b/cmd/dbaas_create_opensearch.go index 3bc158f6..03720be2 100644 --- a/cmd/dbaas_create_opensearch.go +++ b/cmd/dbaas_create_opensearch.go @@ -71,10 +71,6 @@ func (c *dbaasServiceCreateCmd) createOpensearch(cmd *cobra.Command, _ []string) db.OpensearchSettings = &settings } - if cmd.Flags().Changed(mustCLICommandFlagName(c, &c.OpensearchMaxIndexCount)) { - db.MaxIndexCount = &c.OpensearchMaxIndexCount - } - if cmd.Flags().Changed(mustCLICommandFlagName(c, &c.OpensearchDashboardEnabled)) { db.OpensearchDashboards.Enabled = &c.OpensearchDashboardEnabled } diff --git a/cmd/dbaas_show_opensearch.go b/cmd/dbaas_show_opensearch.go index fae081e1..2642bc45 100644 --- a/cmd/dbaas_show_opensearch.go +++ b/cmd/dbaas_show_opensearch.go @@ -71,7 +71,6 @@ type dbServiceOpensearchShowOutput struct { IndexPatterns []dbServiceOpensearchIndexPatternShowOutput `json:"index-patterns,omitempty"` IndexTemplate *dbServiceOpensearchIndexTemplateShowOutput `json:"index-template,omitempty"` KeepIndexRefreshInterval bool `json:"keep-index-refresh-interval,omitempty"` - MaxIndexCount int64 `json:"max-index-count,omitempty"` Dashboard *dbServiceOpensearchDashboardShowOutput `json:"opensearch-dashboards,omitempty"` Users []dbServiceOpensearchUserShowOutput `json:"users,omitempty"` } @@ -113,7 +112,6 @@ func formatDatabaseServiceOpensearchTable(t *table.Table, o *dbServiceOpensearch t.Append([]string{"IndexTemplate", indexTemplate}) t.Append([]string{"KeepIndexRefreshInterval", fmt.Sprint(o.KeepIndexRefreshInterval)}) - t.Append([]string{"MaxIndexCount", strconv.FormatInt(o.MaxIndexCount, 10)}) var dashboard string if o.Dashboard != nil { @@ -337,7 +335,6 @@ func opensearchShowDatabase(db *oapi.DbaasServiceOpensearch, zone string) (outpu IndexPatterns: indexPatterns, IndexTemplate: indexTemplate, KeepIndexRefreshInterval: utils.DefaultBool(db.KeepIndexRefreshInterval, false), - MaxIndexCount: utils.DefaultInt64(db.MaxIndexCount, 0), Dashboard: dashboard, Users: users, }, diff --git a/cmd/dbaas_update.go b/cmd/dbaas_update.go index e293ae09..3da9d184 100644 --- a/cmd/dbaas_update.go +++ b/cmd/dbaas_update.go @@ -48,7 +48,6 @@ type dbaasServiceUpdateCmd struct { KafkaSettings string `cli-flag:"kafka-settings" cli-usage:"Kafka configuration settings (JSON format)" cli-hidden:""` // "opensearch" type specific flags - OpensearchMaxIndexCount int64 `cli-flag:"opensearch-max-index-count" cli-usage:"Maximum number of indexes to keep before deleting the oldest one" cli-hidden:""` OpensearchKeepIndexRefreshInterval bool `cli-flag:"opensearch-keep-index-refresh-interval" cli-usage:"index.refresh_interval is reset to default value for every index to be sure that indices are always visible to search. Set to true disable this." cli-hidden:""` OpensearchIPFilter []string `cli-flag:"opensearch-ip-filter" cli-usage:"Allow incoming connections from CIDR address block" cli-hidden:""` OpensearchIndexPatterns string `cli-flag:"opensearch-index-patterns" cli-usage:"JSON Array of index patterns (https://openapi-v2.exoscale.com/#operation-get-dbaas-service-opensearch-200-index-patterns)" cli-hidden:""` diff --git a/cmd/dbaas_update_opensearch.go b/cmd/dbaas_update_opensearch.go index 66422110..85b210fb 100644 --- a/cmd/dbaas_update_opensearch.go +++ b/cmd/dbaas_update_opensearch.go @@ -67,11 +67,6 @@ func (c *dbaasServiceUpdateCmd) updateOpensearch(cmd *cobra.Command, _ []string) updated = true } - if cmd.Flags().Changed(mustCLICommandFlagName(c, &c.OpensearchMaxIndexCount)) { - db.MaxIndexCount = &c.OpensearchMaxIndexCount - updated = true - } - if cmd.Flags().Changed(mustCLICommandFlagName(c, &c.OpensearchDashboardEnabled)) { db.OpensearchDashboards.Enabled = &c.OpensearchDashboardEnabled updated = true From 71bd52b7ed3d4b6f65b9931cc7160df21b6cf258 Mon Sep 17 00:00:00 2001 From: Predrag Janosevic Date: Fri, 14 Jun 2024 16:26:50 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d4082d..ad4a0ff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - go.mk: lint with staticcheck #606 - Update deprecated goreleaser directives #607 +### Bug Fixes + +- dbaas opensearch: remove top-level max-index-count flag #611 + ## 1.78.2 ### Bug Fixes