(ctx devspacecontext.Context, basePath, parentConfigName string, currentDependency *Dependency, dependencies []*latest.DependencyConfig, options ResolveOptions)
| 113 | } |
| 114 | |
| 115 | func (r *resolver) resolveRecursive(ctx devspacecontext.Context, basePath, parentConfigName string, currentDependency *Dependency, dependencies []*latest.DependencyConfig, options ResolveOptions) error { |
| 116 | if currentDependency != nil { |
| 117 | currentDependency.children = []types.Dependency{} |
| 118 | } |
| 119 | for _, dependencyConfig := range dependencies { |
| 120 | if contains(options.SkipDependencies, dependencyConfig.Name) { |
| 121 | continue |
| 122 | } |
| 123 | |
| 124 | if len(options.Dependencies) > 0 && !stringutil.Contains(options.Dependencies, dependencyConfig.Name) { |
| 125 | continue |
| 126 | } |
| 127 | |
| 128 | if dependencyConfig.Disabled { |
| 129 | ctx.Log().Debugf("Skip dependency %s, because it is disabled", dependencyConfig.Name) |
| 130 | continue |
| 131 | } |
| 132 | |
| 133 | dependencyConfigPath, err := util.DownloadDependency(ctx.Context(), basePath, dependencyConfig.Source, ctx.Log()) |
| 134 | if err != nil { |
| 135 | return err |
| 136 | } |
| 137 | |
| 138 | // Try to insert new edge |
| 139 | var ( |
| 140 | child *Dependency |
| 141 | ) |
| 142 | if n, ok := r.DependencyGraph.Nodes[dependencyConfig.Name]; ok { |
| 143 | child = n.Data.(*Dependency) |
| 144 | if child != nil && child.Config() != nil && child.Config().Path() != dependencyConfigPath && !child.Root() { |
| 145 | ctx.Log().Warnf("Seems like you have multiple dependencies with name %s, but they use different source settings (%s != %s). This can lead to unexpected results and you should make sure that the devspace.yaml name is unique across your dependencies or that you use the dependencies.overrideName option", child.name, child.Config().Path(), dependencyConfigPath) |
| 146 | } |
| 147 | |
| 148 | err := r.DependencyGraph.AddEdge(parentConfigName, dependencyConfig.Name) |
| 149 | if err != nil { |
| 150 | if _, ok := err.(*graph.CyclicError); !ok { |
| 151 | return err |
| 152 | } |
| 153 | |
| 154 | ctx.Log().Debugf(err.Error()) |
| 155 | } |
| 156 | } else { |
| 157 | child, err = r.resolveDependency(ctx, dependencyConfigPath, dependencyConfig.Name, dependencyConfig) |
| 158 | if err != nil { |
| 159 | return err |
| 160 | } |
| 161 | |
| 162 | _, err = r.DependencyGraph.InsertNodeAt(parentConfigName, dependencyConfig.Name, child) |
| 163 | if err != nil { |
| 164 | return errors.Wrap(err, "insert node") |
| 165 | } |
| 166 | |
| 167 | // load dependencies from dependency |
| 168 | if !dependencyConfig.IgnoreDependencies && child.localConfig.Config().Dependencies != nil && len(child.localConfig.Config().Dependencies) > 0 { |
| 169 | err = r.resolveRecursive(ctx, child.absolutePath, dependencyConfig.Name, child, transformMap(child.localConfig.Config().Dependencies), options) |
| 170 | if err != nil { |
| 171 | return err |
| 172 | } |
no test coverage detected