Skip to content

Commit

Permalink
MM-60336: Allow ability to create empty OS (#874)
Browse files Browse the repository at this point in the history
* MM-60336: Allow ability to create empty OS

https://mattermost.atlassian.net/browse/MM-60336
  • Loading branch information
agnivade authored Dec 30, 2024
1 parent 2f5a8be commit cbc059e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
8 changes: 0 additions & 8 deletions deployment/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,14 +468,6 @@ func (c *Config) validateElasticSearchConfig() error {
return fmt.Errorf("Incorrect engine version: %s. Must start with %q", c.ElasticSearchSettings.Version, "OpenSearch")
}

if c.ElasticSearchSettings.SnapshotRepository == "" {
return fmt.Errorf("Empty SnapshotRepository. Must supply a value")
}

if c.ElasticSearchSettings.SnapshotName == "" {
return fmt.Errorf("Empty SnapshotName. Must supply a value")
}

return nil
}

Expand Down
6 changes: 3 additions & 3 deletions deployment/terraform/assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion deployment/terraform/assets/elasticsearch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ resource "aws_opensearch_domain" "es_server" {
dynamic "log_publishing_options" {
for_each = var.es_enable_cloudwatch_logs ? [true] : []
content {
cloudwatch_log_group_arn = aws_cloudwatch_log_group.es_log_group.arn
# Just using index 0 because the count is mainly used to control one or none.
# We don't have a need for multiple log groups.
# https://github.com/mattermost/mattermost-load-test-ng/pull/874#issuecomment-2544984861
cloudwatch_log_group_arn = aws_cloudwatch_log_group.es_log_group[0].arn
log_type = "ES_APPLICATION_LOGS"
}
}
Expand Down
6 changes: 5 additions & 1 deletion deployment/terraform/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ func (t *Terraform) setupElasticSearchServer(extAgent *ssh.ExtAgent, ip string)
mlog.Debug("Repositories registered", mlog.Array("repositories", repositories))

repo := esSettings.SnapshotRepository
snapshotName := esSettings.SnapshotName
if snapshotName == "" {
mlog.Debug("No Opensearch snapshot name given. Not restoring to any snapshot.")
return nil
}

// Check if the registered repositories already include the one configured
repoFound := false
Expand Down Expand Up @@ -577,7 +582,6 @@ func (t *Terraform) setupElasticSearchServer(extAgent *ssh.ExtAgent, ip string)

// Look for the configured snapshot
var snapshot opensearch.Snapshot
snapshotName := esSettings.SnapshotName
for _, s := range snapshots {
if s.Name == snapshotName {
snapshot = s
Expand Down

0 comments on commit cbc059e

Please sign in to comment.