Hello community, here is the log from the commit of package helm for openSUSE:Factory checked in at 2020-10-03 18:56:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/helm (Old) and /work/SRC/openSUSE:Factory/.helm.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "helm" Sat Oct 3 18:56:16 2020 rev:18 rq:838470 version:3.3.4 Changes: -------- --- /work/SRC/openSUSE:Factory/helm/helm.changes 2020-09-24 16:13:26.576850545 +0200 +++ /work/SRC/openSUSE:Factory/.helm.new.4249/helm.changes 2020-10-03 18:56:54.717575955 +0200 @@ -1,0 +2,8 @@ +Mon Sep 28 19:49:33 UTC 2020 - dmuel...@suse.com + +- Update to version 3.3.4: + * Fixing import package issue + * use warning function + * Fixing issue with idempotent repo add + +------------------------------------------------------------------- Old: ---- helm-3.3.3.tar.gz New: ---- helm-3.3.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ helm.spec ++++++ --- /var/tmp/diff_new_pack.XlIt5F/_old 2020-10-03 18:56:55.425576739 +0200 +++ /var/tmp/diff_new_pack.XlIt5F/_new 2020-10-03 18:56:55.425576739 +0200 @@ -18,7 +18,7 @@ %define git_commit ac925eb7279f4a6955df663a0128044a8a6b7593 Name: helm -Version: 3.3.3 +Version: 3.3.4 Release: 0 Summary: The Kubernetes Package Manager License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.XlIt5F/_old 2020-10-03 18:56:55.457576774 +0200 +++ /var/tmp/diff_new_pack.XlIt5F/_new 2020-10-03 18:56:55.461576778 +0200 @@ -5,7 +5,7 @@ <param name="exclude">.git</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> - <param name="revision">v3.3.3</param> + <param name="revision">v3.3.4</param> <param name="changesgenerate">enable</param> </service> <service name="recompress" mode="disabled"> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.XlIt5F/_old 2020-10-03 18:56:55.481576801 +0200 +++ /var/tmp/diff_new_pack.XlIt5F/_new 2020-10-03 18:56:55.481576801 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/kubernetes/helm.git</param> - <param name="changesrevision">55e3ca022e40fe200fbc855938995f40b2a68ce0</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">a61ce5633af99708171414353ed49547cf05013d</param></service></servicedata> \ No newline at end of file ++++++ helm-3.3.3.tar.gz -> helm-3.3.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/registry_login.go new/helm-3.3.4/cmd/helm/registry_login.go --- old/helm-3.3.3/cmd/helm/registry_login.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/registry_login.go 2020-09-23 00:00:58.000000000 +0200 @@ -104,7 +104,7 @@ } } } else { - fmt.Fprintln(os.Stderr, "WARNING! Using --password via the CLI is insecure. Use --password-stdin.") + warning("Using --password via the CLI is insecure. Use --password-stdin.") } return username, password, nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/repo_add.go new/helm-3.3.4/cmd/helm/repo_add.go --- old/helm-3.3.3/cmd/helm/repo_add.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/repo_add.go 2020-09-23 00:00:58.000000000 +0200 @@ -114,11 +114,6 @@ return err } - // If the repo exists and --force-update was not specified, error out. - if !o.forceUpdate && f.Has(o.name) { - return errors.Errorf("repository name (%s) already exists, please specify a different name", o.name) - } - c := repo.Entry{ Name: o.name, URL: o.url, @@ -130,6 +125,23 @@ InsecureSkipTLSverify: o.insecureSkipTLSverify, } + // If the repo exists do one of two things: + // 1. If the configuration for the name is the same continue without error + // 2. When the config is different require --force-update + if !o.forceUpdate && f.Has(o.name) { + existing := f.Get(o.name) + if c != *existing { + + // The input coming in for the name is different from what is already + // configured. Return an error. + return errors.Errorf("repository name (%s) already exists, please specify a different name", o.name) + } + + // The add is idempotent so do nothing + fmt.Fprintf(out, "%q already exists with the same configuration, skipping\n", o.name) + return nil + } + r, err := repo.NewChartRepository(&c, getter.All(settings)) if err != nil { return err diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/repo_add_test.go new/helm-3.3.4/cmd/helm/repo_add_test.go --- old/helm-3.3.3/cmd/helm/repo_add_test.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/repo_add_test.go 2020-09-23 00:00:58.000000000 +0200 @@ -40,14 +40,38 @@ } defer srv.Stop() + // A second test server is setup to verify URL changing + srv2, err := repotest.NewTempServer("testdata/testserver/*.*") + if err != nil { + t.Fatal(err) + } + defer srv2.Stop() + tmpdir := ensure.TempDir(t) repoFile := filepath.Join(tmpdir, "repositories.yaml") - tests := []cmdTestCase{{ - name: "add a repository", - cmd: fmt.Sprintf("repo add test-name %s --repository-config %s --repository-cache %s", srv.URL(), repoFile, tmpdir), - golden: "output/repo-add.txt", - }} + tests := []cmdTestCase{ + { + name: "add a repository", + cmd: fmt.Sprintf("repo add test-name %s --repository-config %s --repository-cache %s", srv.URL(), repoFile, tmpdir), + golden: "output/repo-add.txt", + }, + { + name: "add repository second time", + cmd: fmt.Sprintf("repo add test-name %s --repository-config %s --repository-cache %s", srv.URL(), repoFile, tmpdir), + golden: "output/repo-add2.txt", + }, + { + name: "add repository different url", + cmd: fmt.Sprintf("repo add test-name %s --repository-config %s --repository-cache %s", srv2.URL(), repoFile, tmpdir), + wantError: true, + }, + { + name: "add repository second time", + cmd: fmt.Sprintf("repo add test-name %s --repository-config %s --repository-cache %s --force-update", srv2.URL(), repoFile, tmpdir), + golden: "output/repo-add.txt", + }, + } runTestCmd(t, tests) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/root.go new/helm-3.3.4/cmd/helm/root.go --- old/helm-3.3.3/cmd/helm/root.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/root.go 2020-09-23 00:00:58.000000000 +0200 @@ -190,7 +190,7 @@ loadPlugins(cmd, out) // Check permissions on critical files - checkPerms(out) + checkPerms() return cmd, nil } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/root_unix.go new/helm-3.3.4/cmd/helm/root_unix.go --- old/helm-3.3.3/cmd/helm/root_unix.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/root_unix.go 2020-09-23 00:00:58.000000000 +0200 @@ -19,14 +19,12 @@ package main import ( - "fmt" - "io" "os" "os/user" "path/filepath" ) -func checkPerms(out io.Writer) { +func checkPerms() { // This function MUST NOT FAIL, as it is just a check for a common permissions problem. // If for some reason the function hits a stopping condition, it may panic. But only if // we can be sure that it is panicing because Helm cannot proceed. @@ -52,9 +50,9 @@ perm := fi.Mode().Perm() if perm&0040 > 0 { - fmt.Fprintf(out, "WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: %s\n", kc) + warning("Kubernetes configuration file is group-readable. This is insecure. Location: %s", kc) } if perm&0004 > 0 { - fmt.Fprintf(out, "WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: %s\n", kc) + warning("Kubernetes configuration file is world-readable. This is insecure. Location: %s", kc) } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/root_unix_test.go new/helm-3.3.4/cmd/helm/root_unix_test.go --- old/helm-3.3.3/cmd/helm/root_unix_test.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/root_unix_test.go 2020-09-23 00:00:58.000000000 +0200 @@ -19,7 +19,7 @@ package main import ( - "bytes" + "bufio" "io/ioutil" "os" "path/filepath" @@ -28,6 +28,14 @@ ) func TestCheckPerms(t *testing.T) { + // NOTE(bacongobbler): have to open a new file handler here as the default os.Sterr cannot be read from + stderr, err := os.Open("/dev/stderr") + if err != nil { + t.Fatalf("could not open /dev/stderr for reading: %s", err) + } + defer stderr.Close() + reader := bufio.NewReader(stderr) + tdir, err := ioutil.TempDir("", "helmtest") if err != nil { t.Fatal(err) @@ -43,21 +51,26 @@ settings.KubeConfig = tfile defer func() { settings.KubeConfig = tconfig }() - var b bytes.Buffer - checkPerms(&b) + checkPerms() + text, err := reader.ReadString('\n') + if err != nil { + t.Fatalf("could not read from stderr: %s", err) + } expectPrefix := "WARNING: Kubernetes configuration file is group-readable. This is insecure. Location:" - if !strings.HasPrefix(b.String(), expectPrefix) { - t.Errorf("Expected to get a warning for group perms. Got %q", b.String()) + if !strings.HasPrefix(text, expectPrefix) { + t.Errorf("Expected to get a warning for group perms. Got %q", text) } if err := fh.Chmod(0404); err != nil { t.Errorf("Could not change mode on file: %s", err) } - b.Reset() - checkPerms(&b) + checkPerms() + text, err = reader.ReadString('\n') + if err != nil { + t.Fatalf("could not read from stderr: %s", err) + } expectPrefix = "WARNING: Kubernetes configuration file is world-readable. This is insecure. Location:" - if !strings.HasPrefix(b.String(), expectPrefix) { - t.Errorf("Expected to get a warning for world perms. Got %q", b.String()) + if !strings.HasPrefix(text, expectPrefix) { + t.Errorf("Expected to get a warning for world perms. Got %q", text) } - } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/root_windows.go new/helm-3.3.4/cmd/helm/root_windows.go --- old/helm-3.3.3/cmd/helm/root_windows.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/root_windows.go 2020-09-23 00:00:58.000000000 +0200 @@ -16,9 +16,7 @@ package main -import "io" - -func checkPerms(out io.Writer) { +func checkPerms() { // Not yet implemented on Windows. If you know how to do a comprehensive perms // check on Windows, contributions welcomed! } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/search_repo.go new/helm-3.3.4/cmd/helm/search_repo.go --- old/helm-3.3.3/cmd/helm/search_repo.go 2020-09-18 18:47:06.000000000 +0200 +++ new/helm-3.3.4/cmd/helm/search_repo.go 2020-09-23 00:00:58.000000000 +0200 @@ -22,7 +22,6 @@ "fmt" "io" "io/ioutil" - "os" "path/filepath" "strings" @@ -184,7 +183,7 @@ f := filepath.Join(o.repoCacheDir, helmpath.CacheIndexFile(n)) ind, err := repo.LoadIndexFile(f) if err != nil { - fmt.Fprintf(os.Stderr, "WARNING: Repo %q is corrupt or missing. Try 'helm repo update'.", n) + warning("Repo %q is corrupt or missing. Try 'helm repo update'.", n) continue } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helm-3.3.3/cmd/helm/testdata/output/repo-add2.txt new/helm-3.3.4/cmd/helm/testdata/output/repo-add2.txt --- old/helm-3.3.3/cmd/helm/testdata/output/repo-add2.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/helm-3.3.4/cmd/helm/testdata/output/repo-add2.txt 2020-09-23 00:00:58.000000000 +0200 @@ -0,0 +1 @@ +"test-name" already exists with the same configuration, skipping ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/helm/vendor.tar.gz /work/SRC/openSUSE:Factory/.helm.new.4249/vendor.tar.gz differ: char 5, line 1