MCPcopy Index your code
hub / github.com/devspace-sh/devspace / LoadConfigWithOptionsAndResolve

Function LoadConfigWithOptionsAndResolve

e2e/framework/util.go:32–68  ·  view source on GitHub ↗
(f factory.Factory, client kubectl.Client, configPath string, configOptions *loader.ConfigOptions, resolveOptions dependency.ResolveOptions)

Source from the content-addressed store, hash-verified

30}
31
32func LoadConfigWithOptionsAndResolve(f factory.Factory, client kubectl.Client, configPath string, configOptions *loader.ConfigOptions, resolveOptions dependency.ResolveOptions) (config.Config, []types.Dependency, error) {
33 before, err := os.Getwd()
34 if err != nil {
35 return nil, nil, err
36 }
37 defer SwitchDir(before)
38
39 // Set config root
40 log := f.GetLog()
41 configLoader, err := f.NewConfigLoader(configPath)
42 if err != nil {
43 return nil, nil, err
44 }
45 configExists, err := configLoader.SetDevSpaceRoot(log)
46 if err != nil {
47 return nil, nil, err
48 } else if !configExists {
49 return nil, nil, errors.New(message.ConfigNotFound)
50 }
51
52 // load config
53 loadedConfig, err := configLoader.Load(context.Background(), client, configOptions, log)
54 if err != nil {
55 return nil, nil, err
56 }
57
58 // set devspacecontext
59 ctx := devspacecontext.NewContext(context.Background(), loadedConfig.Variables(), log).WithConfig(loadedConfig)
60
61 // resolve dependencies
62 dependencies, err := dependency.NewManager(ctx, configOptions).ResolveAll(ctx, resolveOptions)
63 if err != nil {
64 return nil, nil, fmt.Errorf("error resolving dependencies: %v", err)
65 }
66
67 return loadedConfig, dependencies, nil
68}
69
70func LoadConfigWithOptions(f factory.Factory, client kubectl.Client, configPath string, configOptions *loader.ConfigOptions) (config.Config, []types.Dependency, error) {
71 return LoadConfigWithOptionsAndResolve(f, client, configPath, configOptions, dependency.ResolveOptions{})

Callers 2

dependencies.goFile · 0.92
LoadConfigWithOptionsFunction · 0.85

Calls 10

SetDevSpaceRootMethod · 0.95
LoadMethod · 0.95
NewManagerFunction · 0.92
SwitchDirFunction · 0.85
GetLogMethod · 0.65
NewConfigLoaderMethod · 0.65
WithConfigMethod · 0.65
VariablesMethod · 0.65
ResolveAllMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected