Skip to content

Commit

Permalink
Set provider in app after config read, fixes #2243 (#2274)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed May 22, 2020
1 parent 447c2b7 commit 62f82b8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/ddevapp/config.go
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

0 comments on commit 62f82b8

Please sign in to comment.