@@ -41,13 +41,14 @@ type GetChartRepositoryCallback func(url string) (*repository.ChartRepository, e
4141
4242// DependencyManager manages dependencies for a Helm chart.
4343type 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.
4748 repositories map [string ]* repository.ChartRepository
4849
4950 // 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.
5152 getRepositoryCallback GetChartRepositoryCallback
5253
5354 // concurrent is the number of concurrent chart-add operations during
@@ -91,6 +92,8 @@ func NewDependencyManager(opts ...DependencyManagerOption) *DependencyManager {
9192 return dm
9293}
9394
95+ // Clear iterates over the repositories, calling Unload and RemoveCache on all
96+ // items. It returns a collection of (cache removal) errors.
9497func (dm * DependencyManager ) Clear () []error {
9598 var errs []error
9699 for _ , v := range dm .repositories {
@@ -294,9 +297,9 @@ func (dm *DependencyManager) secureLocalChartPath(ref LocalReference, dep *helmc
294297 return securejoin .SecureJoin (ref .WorkDir , filepath .Join (relPath , localUrl .Host , localUrl .Path ))
295298}
296299
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.
300303func collectMissing (current []* helmchart.Chart , reqs []* helmchart.Dependency ) map [string ]* helmchart.Dependency {
301304 // If the number of dependencies equals the number of requested
302305 // dependencies, there are no missing dependencies
0 commit comments