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

Set provider in app after config read, fixes #2243 #2274

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions pkg/ddevapp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,6 @@ func NewApp(appRoot string, includeOverrides bool, provider string) (*DdevApp, e
}
app.SetApptypeSettingsPaths()

// Allow override with provider.
// Otherwise we accept whatever might have been in config file if there was anything.
if provider == "" && app.Provider != "" {
// Do nothing. This is the case where the config has a provider and no override is provided. Config wins.
} else if provider == nodeps.ProviderPantheon || provider == nodeps.ProviderDrudS3 || provider == nodeps.ProviderDefault {
app.Provider = provider // Use the provider passed-in. Function argument wins.
} else if provider == "" && app.Provider == "" {
app.Provider = nodeps.ProviderDefault // Nothing passed in, nothing configured. Set c.Provider to default
} else {
return app, fmt.Errorf("provider '%s' is not implemented", provider)
}
app.SetInstrumentationAppTags()

// Rendered yaml is not there until after ddev config or ddev start
Expand All @@ -133,6 +122,17 @@ func NewApp(appRoot string, includeOverrides bool, provider string) (*DdevApp, e
}
}

// Allow override with provider.
// Otherwise we accept whatever might have been in config file if there was anything.
if provider == "" && app.Provider != "" {
// Do nothing. This is the case where the config has a provider and no override is provided. Config wins.
} else if provider == nodeps.ProviderPantheon || provider == nodeps.ProviderDrudS3 || provider == nodeps.ProviderDefault {
app.Provider = provider // Use the provider passed-in. Function argument wins.
} else if provider == "" && app.Provider == "" {
app.Provider = nodeps.ProviderDefault // Nothing passed in, nothing configured. Set c.Provider to default
} else {
return app, fmt.Errorf("provider '%s' is not implemented", provider)
}
return app, nil
}

Expand Down