MCPcopy Index your code
hub / github.com/ddev/ddev / LoadConfigYamlFile

Method LoadConfigYamlFile

pkg/ddevapp/config.go:421–440  ·  view source on GitHub ↗

LoadConfigYamlFile loads one config.yaml into app, overriding what might be there.

(filePath string)

Source from the content-addressed store, hash-verified

419
420// LoadConfigYamlFile loads one config.yaml into app, overriding what might be there.
421func (app *DdevApp) LoadConfigYamlFile(filePath string) error {
422 // Implement Single-Step Loading for a single file ONLY
423 err := settings.LoadProjectConfig(filePath, []string{}, app)
424 if err != nil {
425 return fmt.Errorf("unable to load config: %v", err)
426 }
427
428 // Sort WebExtraExposedPorts so the entry matching configured router ports comes first
429 SortWebExtraExposedPorts(app)
430
431 app.ConfigPostLoadCleanup()
432
433 // Add Post-Load Validation (Upload Dirs)
434 err = app.validateUploadDirs()
435 if err != nil {
436 return err
437 }
438
439 return nil
440}
441
442// ConfigPostLoadCleanup performs cleanup of configuration after loading/merging.
443// This ensures parity with the removed mergeAdditionalConfigIntoApp function.

Callers 3

TestLoadConfigYamlFileFunction · 0.95

Calls 5

ConfigPostLoadCleanupMethod · 0.95
validateUploadDirsMethod · 0.95
LoadProjectConfigFunction · 0.92
SortWebExtraExposedPortsFunction · 0.85
ErrorfMethod · 0.80

Tested by 3

TestLoadConfigYamlFileFunction · 0.76