(ctx context.Context, config types.ConfigDetails, opts *Options, ct *cycleTracker, included []string)
| 397 | } |
| 398 | |
| 399 | func loadYamlModel(ctx context.Context, config types.ConfigDetails, opts *Options, ct *cycleTracker, included []string) (map[string]interface{}, error) { |
| 400 | var ( |
| 401 | dict = map[string]interface{}{} |
| 402 | err error |
| 403 | ) |
| 404 | workingDir, environment := config.WorkingDir, config.Environment |
| 405 | |
| 406 | for _, file := range config.ConfigFiles { |
| 407 | dict, _, err = loadYamlFile(ctx, file, opts, workingDir, environment, ct, dict, included) |
| 408 | if err != nil { |
| 409 | return nil, err |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | if !opts.SkipDefaultValues { |
| 414 | dict, err = transform.SetDefaultValues(dict) |
| 415 | if err != nil { |
| 416 | return nil, err |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | if !opts.SkipValidation { |
| 421 | if err := validation.Validate(dict); err != nil { |
| 422 | return nil, err |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | if opts.ResolvePaths { |
| 427 | var remotes []paths.RemoteResource |
| 428 | for _, loader := range opts.RemoteResourceLoaders() { |
| 429 | remotes = append(remotes, loader.Accept) |
| 430 | } |
| 431 | err = paths.ResolveRelativePaths(dict, config.WorkingDir, remotes) |
| 432 | if err != nil { |
| 433 | return nil, err |
| 434 | } |
| 435 | } |
| 436 | ResolveEnvironment(dict, config.Environment) |
| 437 | |
| 438 | return dict, nil |
| 439 | } |
| 440 | |
| 441 | func loadYamlFile(ctx context.Context, |
| 442 | file types.ConfigFile, |
searching dependent graphs…