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-61280] disable init data if providing external database #870

Merged
merged 5 commits into from
Dec 16, 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
2 changes: 1 addition & 1 deletion cmd/ltctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func RunCreateCmdF(cmd *cobra.Command, args []string) error {
return fmt.Errorf("failed to create SSH agent: %w", err)
}

initData := config.DBDumpURI == ""
initData := config.DBDumpURI == "" && config.ExternalDBSettings.DataSource == ""
if err = t.Create(extAgent, initData); err != nil {
return fmt.Errorf("failed to create terraform env: %w", err)
}
Expand Down
4 changes: 4 additions & 0 deletions deployment/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ func (c *Config) IsValid() error {
return fmt.Errorf("load-test download url is not in correct format: %q", c.LoadTestDownloadURL)
}

if c.ExternalDBSettings.DataSource != "" && c.DBDumpURI != "" {
return fmt.Errorf("both ExternalDBSettings.DataSource and DBDumpURI are set, only one can be set")
}

if err := c.validateElasticSearchConfig(); err != nil {
return err
}
Expand Down
4 changes: 4 additions & 0 deletions docs/config/deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ The file is expected to be gzip compressed.
This can also point to a local file if prefixed with "file://".
In such case, the dump file will be uploaded to the app servers.

Loading a dump into a database only work for terraform created databases.
If you are using an existing database by relying on [`ExternalDBSettings`](#ExternalDBSettings)
you need to load the dump manually.

## SiteURL

*string*
Expand Down
Loading