From 4f62d3dc1b8b95246eb345f8e9117adee6d52f91 Mon Sep 17 00:00:00 2001 From: Andrew Block Date: Sun, 9 Jan 2022 19:51:03 -0600 Subject: [PATCH] Started work on 'helm pull' Signed-off-by: Andrew Block --- internal/resolver/resolver.go | 2 -- pkg/action/pull.go | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/resolver/resolver.go b/internal/resolver/resolver.go index 36a4803e1..5afb439e3 100644 --- a/internal/resolver/resolver.go +++ b/internal/resolver/resolver.go @@ -18,7 +18,6 @@ package resolver import ( "bytes" "encoding/json" - "fmt" "os" "path/filepath" "strings" @@ -137,7 +136,6 @@ func (r *Resolver) Resolve(reqs []*chart.Dependency, repoNames map[string]string } found = false } else { - fmt.Println("Entering OCI block") version = d.Version if !FeatureGateOCI.IsEnabled() { return nil, errors.Wrapf(FeatureGateOCI.Error(), diff --git a/pkg/action/pull.go b/pkg/action/pull.go index 2f5127ea9..f09da82d0 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -92,13 +92,13 @@ func (p *Pull) Run(chartRef string) (string, error) { } if registry.IsOCI(chartRef) { - if p.Version == "" { - return out.String(), errors.Errorf("--version flag is explicitly required for OCI registries") - } - c.Options = append(c.Options, - getter.WithRegistryClient(p.cfg.RegistryClient), - getter.WithTagName(p.Version)) + getter.WithRegistryClient(p.cfg.RegistryClient)) + + if p.Version != "" { + c.Options = append(c.Options, + getter.WithTagName(p.Version)) + } } if p.Verify {