Skip to content

Commit

Permalink
dbaas opensearch: remove top-level max-index-count flag (#611)
Browse files Browse the repository at this point in the history
This PR removes `--max-index-count` flag as Aiven API ignores any
changes of the value.
**Index patterns `max-index-count` is still supported!**
  • Loading branch information
kobajagi authored Jun 17, 2024
1 parent 54e13cd commit 74f338d
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion cmd/dbaas_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:""`
Expand Down
4 changes: 0 additions & 4 deletions cmd/dbaas_create_opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 0 additions & 3 deletions cmd/dbaas_show_opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
},
Expand Down
1 change: 0 additions & 1 deletion cmd/dbaas_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:""`
Expand Down
5 changes: 0 additions & 5 deletions cmd/dbaas_update_opensearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 74f338d

Please sign in to comment.