Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MM-60336: Allow ability to create empty OS #874

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions deployment/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,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 @@ -540,6 +540,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 @@ -568,7 +573,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
Loading