@@ -41,13 +41,14 @@ type GetChartRepositoryCallback func(url string) (*repository.ChartRepository, e
41
41
42
42
// DependencyManager manages dependencies for a Helm chart.
43
43
type DependencyManager struct {
44
- // repositories contains a map of Index indexed by their
45
- // normalized URL. It is used as a lookup table for missing
46
- // dependencies.
44
+ // repositories contains a map of repository.ChartRepository objects
45
+ // indexed by their repository.NormalizeURL.
46
+ // It is consulted as a lookup table for missing dependencies, based on
47
+ // the (repository) URL the dependency refers to.
47
48
repositories map [string ]* repository.ChartRepository
48
49
49
50
// getRepositoryCallback can be set to an on-demand GetChartRepositoryCallback
50
- // which returned result is cached to repositories.
51
+ // whose returned result is cached to repositories.
51
52
getRepositoryCallback GetChartRepositoryCallback
52
53
53
54
// concurrent is the number of concurrent chart-add operations during
@@ -91,6 +92,8 @@ func NewDependencyManager(opts ...DependencyManagerOption) *DependencyManager {
91
92
return dm
92
93
}
93
94
95
+ // Clear iterates over the repositories, calling Unload and RemoveCache on all
96
+ // items. It returns a collection of (cache removal) errors.
94
97
func (dm * DependencyManager ) Clear () []error {
95
98
var errs []error
96
99
for _ , v := range dm .repositories {
@@ -294,9 +297,9 @@ func (dm *DependencyManager) secureLocalChartPath(ref LocalReference, dep *helmc
294
297
return securejoin .SecureJoin (ref .WorkDir , filepath .Join (relPath , localUrl .Host , localUrl .Path ))
295
298
}
296
299
297
- // collectMissing returns a map with reqs that are missing from current,
298
- // indexed by their alias or name. All dependencies of a chart are present
299
- // if len of returned map == 0.
300
+ // collectMissing returns a map with dependencies from reqs that are missing
301
+ // from current, indexed by their alias or name. All dependencies of a chart
302
+ // are present if len of returned map == 0.
300
303
func collectMissing (current []* helmchart.Chart , reqs []* helmchart.Dependency ) map [string ]* helmchart.Dependency {
301
304
// If the number of dependencies equals the number of requested
302
305
// dependencies, there are no missing dependencies
0 commit comments