diff --git a/cmd/helm/dependency_update.go b/cmd/helm/dependency_update.go index 9855afb92..1c671a0aa 100644 --- a/cmd/helm/dependency_update.go +++ b/cmd/helm/dependency_update.go @@ -62,6 +62,7 @@ func newDependencyUpdateCmd(out io.Writer) *cobra.Command { ChartPath: chartpath, Keyring: client.Keyring, SkipUpdate: client.SkipRefresh, + FileOnly: client.FileOnly, Getters: getter.All(settings), RepositoryConfig: settings.RepositoryConfig, RepositoryCache: settings.RepositoryCache, @@ -78,6 +79,7 @@ func newDependencyUpdateCmd(out io.Writer) *cobra.Command { f.BoolVar(&client.Verify, "verify", false, "verify the packages against signatures") f.StringVar(&client.Keyring, "keyring", defaultKeyring(), "keyring containing public keys") f.BoolVar(&client.SkipRefresh, "skip-refresh", false, "do not refresh the local repository cache") + f.BoolVar(&client.FileOnly, "file-only", false, "refresh only file:// dependencies") return cmd } diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 44f7336c0..65984cdda 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -208,6 +208,7 @@ func runInstall(args []string, client *action.Install, valueOpts *values.Options ChartPath: cp, Keyring: client.ChartPathOptions.Keyring, SkipUpdate: false, + FileOnly: false, Getters: p, RepositoryConfig: settings.RepositoryConfig, RepositoryCache: settings.RepositoryCache, diff --git a/pkg/action/dependency.go b/pkg/action/dependency.go index 4a4b8ebad..df0653f09 100644 --- a/pkg/action/dependency.go +++ b/pkg/action/dependency.go @@ -36,6 +36,7 @@ type Dependency struct { Verify bool Keyring string SkipRefresh bool + FileOnly bool } // NewDependency creates a new Dependency object with the given configuration. diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index 00198de0c..8bf871675 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -56,6 +56,8 @@ type Manager struct { Keyring string // SkipUpdate indicates that the repository should not be updated first. SkipUpdate bool + // FileOnly indicates that only file:// charts should be updated + FileOnly bool // Getter collection for the operation Getters []getter.Provider RepositoryConfig string @@ -277,7 +279,10 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error { } dep.Version = ver continue - } + } else if m.FileOnly { + fmt.Fprintf(m.Out, "Updating file:// dependencies only - skip %s from repo %s\n", dep.Name, dep.Repository) + continue + } // Any failure to resolve/download a chart should fail: // https://github.com/helm/helm/issues/1439