(ctx context.Context, data map[string]interface{}, options *ConfigOptions, resolver variable.Resolver, log log.Logger)
| 531 | } |
| 532 | |
| 533 | func (l *configLoader) applyProfiles(ctx context.Context, data map[string]interface{}, options *ConfigOptions, resolver variable.Resolver, log log.Logger) (map[string]interface{}, error) { |
| 534 | // Get profile |
| 535 | profiles, err := versions.ParseProfile(ctx, filepath.Dir(l.absConfigPath), data, options.Profiles, options.ProfileRefresh, options.DisableProfileActivation, resolver, log) |
| 536 | if err != nil { |
| 537 | return nil, err |
| 538 | } |
| 539 | |
| 540 | // Now delete not needed parts from config |
| 541 | delete(data, "profiles") |
| 542 | |
| 543 | // Apply profiles |
| 544 | for i := len(profiles) - 1; i >= 0; i-- { |
| 545 | // Apply replace |
| 546 | err = ApplyReplace(data, profiles[i]) |
| 547 | if err != nil { |
| 548 | return nil, err |
| 549 | } |
| 550 | |
| 551 | // Apply merge |
| 552 | data, err = ApplyMerge(data, profiles[i]) |
| 553 | if err != nil { |
| 554 | return nil, err |
| 555 | } |
| 556 | |
| 557 | // Apply patches |
| 558 | data, err = ApplyPatches(data, profiles[i]) |
| 559 | if err != nil { |
| 560 | return nil, err |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | return data, nil |
| 565 | } |
| 566 | |
| 567 | // configExistsInPath checks whether a devspace configuration exists at a certain path |
| 568 | func configExistsInPath(path string) bool { |
no test coverage detected