Skip to content

Commit

Permalink
internal/helm: doc block nitpicks
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Nov 19, 2021
1 parent 88ff049 commit 3594188
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions internal/helm/chart/dependency_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ type GetChartRepositoryCallback func(url string) (*repository.ChartRepository, e

// DependencyManager manages dependencies for a Helm chart.
type DependencyManager struct {
// repositories contains a map of Index indexed by their
// normalized URL. It is used as a lookup table for missing
// dependencies.
// repositories contains a map of repository.ChartRepository objects
// indexed by their repository.NormalizeURL.
// It is consulted as a lookup table for missing dependencies, based on
// the (repository) URL the dependency refers to.
repositories map[string]*repository.ChartRepository

// getRepositoryCallback can be set to an on-demand GetChartRepositoryCallback
// which returned result is cached to repositories.
// whose returned result is cached to repositories.
getRepositoryCallback GetChartRepositoryCallback

// concurrent is the number of concurrent chart-add operations during
Expand Down Expand Up @@ -91,6 +92,8 @@ func NewDependencyManager(opts ...DependencyManagerOption) *DependencyManager {
return dm
}

// Clear iterates over the repositories, calling Unload and RemoveCache on all
// items. It returns a collection of (cache removal) errors.
func (dm *DependencyManager) Clear() []error {
var errs []error
for _, v := range dm.repositories {
Expand Down
2 changes: 1 addition & 1 deletion internal/helm/chart/metadata_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 The Flux authors
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions internal/helm/repository/chart_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (r *ChartRepository) CacheIndex() (string, error) {

// StrategicallyLoadIndex lazy-loads the Index from CachePath using
// LoadFromCache if it does not HasIndex.
// If it not HasCacheFile, a cache attempt is made using CacheIndex
// If not HasCacheFile, a cache attempt is made using CacheIndex
// before continuing to load.
func (r *ChartRepository) StrategicallyLoadIndex() (err error) {
if r.HasIndex() {
Expand Down Expand Up @@ -350,7 +350,7 @@ func (r *ChartRepository) HasCacheFile() bool {
}

// Unload can be used to signal the Go garbage collector the Index can
// be freed from memory if the Index object is expected to
// be freed from memory if the ChartRepository object is expected to
// continue to exist in the stack for some time.
func (r *ChartRepository) Unload() {
if r == nil {
Expand Down

0 comments on commit 3594188

Please sign in to comment.