From d4c250f5085c85502b042eba4fd847ffbdf41aa0 Mon Sep 17 00:00:00 2001 From: Dominik Braun Date: Mon, 21 Dec 2020 09:37:16 +0100 Subject: [PATCH] Remove explicit comparison of entry URLs Signed-off-by: Dominik Braun --- cmd/helm/repo_add.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index 1e860aa27..98ccfcd79 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -160,11 +160,10 @@ func (o *repoAddOptions) run(out io.Writer) error { // 2. When the config is different require --force-update if !o.forceUpdate && f.Has(o.name) { existing := f.Get(o.name) - // In case of of the repo URLs ends with a trailing slash and the other - // one doesn't, the config is considered to be different even though they - // refer to the same repository. - // Only fail with an error if the configs actually are different. - if c != *existing && c.URLWithTrailingSlash() != existing.URLWithTrailingSlash() { + existing.URL = existing.URLWithTrailingSlash() + c.URL = c.URLWithTrailingSlash() + // Only fail with an error if the configs are different. + if c != *existing { return errors.Errorf("repository name (%s) already exists, please specify a different name", o.name) }