Skip to content

Commit

Permalink
Merge pull request #1593 from mtrmac/go-1.15
Browse files Browse the repository at this point in the history
Formally require Go 1.15
  • Loading branch information
vrothberg committed Mar 17, 2022
2 parents 0bfe297 + c819bc1 commit 92b1eec
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 333 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ osx_task:
export PATH=$GOPATH/bin:$PATH
brew update
brew install gpgme go go-md2man
go get -u golang.org/x/lint/golint
go install golang.org/x/lint/golint@latest
test_script: |
export PATH=$GOPATH/bin:$PATH
go version
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/containers/skopeo

go 1.12
go 1.15

require (
github.com/Microsoft/go-winio v0.5.2 // indirect
Expand Down
300 changes: 76 additions & 224 deletions integration/copy_test.go

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions integration/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ type openshiftCluster struct {
// in isolated test environment.
func startOpenshiftCluster(c *check.C) *openshiftCluster {
cluster := &openshiftCluster{}

dir, err := ioutil.TempDir("", "openshift-cluster")
c.Assert(err, check.IsNil)
cluster.workingDir = dir
cluster.workingDir = c.MkDir()

cluster.startMaster(c)
cluster.prepareRegistryConfig(c)
Expand Down Expand Up @@ -262,10 +259,6 @@ func (cluster *openshiftCluster) tearDown(c *check.C) {
// so we couldn’t check just for that. This is running in a container anyway…
_ = cluster.processes[i].Process.Kill()
}
if cluster.workingDir != "" {
err := os.RemoveAll(cluster.workingDir)
c.Assert(err, check.IsNil)
}
if cluster.dockerDir != "" {
err := os.RemoveAll(cluster.dockerDir)
c.Assert(err, check.IsNil)
Expand Down
11 changes: 1 addition & 10 deletions integration/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const (
type testRegistryV2 struct {
cmd *exec.Cmd
url string
dir string
username string
password string
email string
Expand All @@ -45,10 +44,7 @@ func setupRegistryV2At(c *check.C, url string, auth, schema1 bool) *testRegistry
}

func newTestRegistryV2At(c *check.C, url string, auth, schema1 bool) (*testRegistryV2, error) {
tmp, err := ioutil.TempDir("", "registry-test-")
if err != nil {
return nil, err
}
tmp := c.MkDir()
template := `version: 0.1
loglevel: debug
storage:
Expand Down Expand Up @@ -86,7 +82,6 @@ http:
return nil, err
}
if _, err := fmt.Fprintf(config, template, tmp, url, htpasswd); err != nil {
os.RemoveAll(tmp)
return nil, err
}

Expand All @@ -98,7 +93,6 @@ http:
cmd := exec.Command(binary, confPath)
consumeAndLogOutputs(c, fmt.Sprintf("registry-%s", url), cmd)
if err := cmd.Start(); err != nil {
os.RemoveAll(tmp)
if os.IsNotExist(err) {
c.Skip(err.Error())
}
Expand All @@ -107,7 +101,6 @@ http:
return &testRegistryV2{
cmd: cmd,
url: url,
dir: tmp,
username: username,
password: password,
email: email,
Expand All @@ -130,6 +123,4 @@ func (t *testRegistryV2) tearDown(c *check.C) {
// It’s undocumented what Kill() returns if the process has terminated,
// so we couldn’t check just for that. This is running in a container anyway…
_ = t.cmd.Process.Kill()
err := os.RemoveAll(t.dir)
c.Assert(err, check.IsNil)
}
16 changes: 4 additions & 12 deletions integration/signing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func init() {
}

type SigningSuite struct {
gpgHome string
fingerprint string
}

Expand All @@ -40,25 +39,18 @@ func (s *SigningSuite) SetUpSuite(c *check.C) {
_, err := exec.LookPath(skopeoBinary)
c.Assert(err, check.IsNil)

s.gpgHome, err = ioutil.TempDir("", "skopeo-gpg")
c.Assert(err, check.IsNil)
os.Setenv("GNUPGHOME", s.gpgHome)
gpgHome := c.MkDir()
os.Setenv("GNUPGHOME", gpgHome)

runCommandWithInput(c, "Key-Type: RSA\nName-Real: Testing user\n%no-protection\n%commit\n", gpgBinary, "--homedir", s.gpgHome, "--batch", "--gen-key")
runCommandWithInput(c, "Key-Type: RSA\nName-Real: Testing user\n%no-protection\n%commit\n", gpgBinary, "--homedir", gpgHome, "--batch", "--gen-key")

lines, err := exec.Command(gpgBinary, "--homedir", s.gpgHome, "--with-colons", "--no-permission-warning", "--fingerprint").Output()
lines, err := exec.Command(gpgBinary, "--homedir", gpgHome, "--with-colons", "--no-permission-warning", "--fingerprint").Output()
c.Assert(err, check.IsNil)
s.fingerprint, err = findFingerprint(lines)
c.Assert(err, check.IsNil)
}

func (s *SigningSuite) TearDownSuite(c *check.C) {
if s.gpgHome != "" {
err := os.RemoveAll(s.gpgHome)
c.Assert(err, check.IsNil)
}
s.gpgHome = ""

os.Unsetenv("GNUPGHOME")
}

Expand Down
Loading

0 comments on commit 92b1eec

Please sign in to comment.