diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-29 11:31:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 11:31:39 -0400 |
commit | 95ff349de22e01eaa76cfc19891cc37952789b82 (patch) | |
tree | ddfaeb501528c01a93624e357774116f4819f210 /test/e2e/push_test.go | |
parent | 73836e0c6a22d919dd8be297bafd137f1bd8ec9e (diff) | |
parent | e6557bf0a291f4462081e50461b1b9b8715d1da3 (diff) | |
download | podman-95ff349de22e01eaa76cfc19891cc37952789b82.tar.gz podman-95ff349de22e01eaa76cfc19891cc37952789b82.tar.bz2 podman-95ff349de22e01eaa76cfc19891cc37952789b82.zip |
Merge pull request #14031 from Luap99/errcheck
enable errcheck linter
Diffstat (limited to 'test/e2e/push_test.go')
-rw-r--r-- | test/e2e/push_test.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go index 3b571ab20..0288bf915 100644 --- a/test/e2e/push_test.go +++ b/test/e2e/push_test.go @@ -101,7 +101,8 @@ var _ = Describe("Podman push", func() { Skip("No registry image for ppc64le") } if rootless.IsRootless() { - podmanTest.RestoreArtifact(registry) + err := podmanTest.RestoreArtifact(registry) + Expect(err).ToNot(HaveOccurred()) } lock := GetPortLock("5000") defer lock.Unlock() @@ -132,8 +133,10 @@ var _ = Describe("Podman push", func() { Skip("No registry image for ppc64le") } authPath := filepath.Join(podmanTest.TempDir, "auth") - os.Mkdir(authPath, os.ModePerm) - os.MkdirAll("/etc/containers/certs.d/localhost:5000", os.ModePerm) + err = os.Mkdir(authPath, os.ModePerm) + Expect(err).ToNot(HaveOccurred()) + err = os.MkdirAll("/etc/containers/certs.d/localhost:5000", os.ModePerm) + Expect(err).ToNot(HaveOccurred()) defer os.RemoveAll("/etc/containers/certs.d/localhost:5000") cwd, _ := os.Getwd() @@ -157,11 +160,14 @@ var _ = Describe("Podman push", func() { session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - f, _ := os.Create(filepath.Join(authPath, "htpasswd")) + f, err := os.Create(filepath.Join(authPath, "htpasswd")) + Expect(err).ToNot(HaveOccurred()) defer f.Close() - f.WriteString(session.OutputToString()) - f.Sync() + _, err = f.WriteString(session.OutputToString()) + Expect(err).ToNot(HaveOccurred()) + err = f.Sync() + Expect(err).ToNot(HaveOccurred()) session = podmanTest.Podman([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v", strings.Join([]string{authPath, "/auth"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e", |