Skip to content

Commit

Permalink
MM-60336: Allow ability to create empty OS
Browse files Browse the repository at this point in the history
  • Loading branch information
agnivade committed Dec 13, 2024
1 parent cacf82f commit d6609d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
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: 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

0 comments on commit d6609d5

Please sign in to comment.