Add --file-only flag to helm dep up to update only file:// dependencies

Signed-off-by: Andy Kilpatrick <Andy.Kilpatrick@metaswitch.com>
pull/8167/head
Andy Kilpatrick 5 years ago
parent cc8f8024a8
commit 1af0a811cc

@ -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
}

@ -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,

@ -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.

@ -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,6 +279,9 @@ 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:

Loading…
Cancel
Save