File tree 4 files changed +31
-24
lines changed
4 files changed +31
-24
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ ignored = [
29
29
30
30
[[constraint ]]
31
31
name = " github.com/fsouza/go-dockerclient"
32
- version = " 1.0 .0"
32
+ version = " 1.2 .0"
33
33
34
34
[[constraint ]]
35
35
branch = " master"
Original file line number Diff line number Diff line change @@ -8,41 +8,21 @@ package runner
8
8
9
9
import (
10
10
"context"
11
- "encoding/base32"
12
11
"fmt"
13
12
"io"
14
13
"net"
15
14
"net/http"
16
15
"os"
17
16
"strconv"
18
- "strings"
19
17
"sync"
20
18
"time"
21
19
22
20
docker "github.com/fsouza/go-dockerclient"
23
- "github.com/hyperledger/fabric/common/util"
24
21
"github.com/pkg/errors"
25
22
"github.com/tedsuo/ifrit"
26
23
)
27
24
28
- const (
29
- DefaultImage = "hyperledger/fabric-couchdb:latest"
30
- DefaultStartTimeout = 30 * time .Second
31
- )
32
-
33
- // A NameFunc is used to generate container names.
34
- type NameFunc func () string
35
-
36
- // DefaultNamer is the default naming function.
37
- var DefaultNamer NameFunc = UniqueName
38
-
39
- // UniqueName is a NamerFunc that generates base-32 enocded UUIDs for container
40
- // names.
41
- func UniqueName () string {
42
- uuid := util .GenerateBytesUUID ()
43
- encoded := base32 .StdEncoding .WithPadding (base32 .NoPadding ).EncodeToString (uuid )
44
- return strings .ToLower (encoded )
45
- }
25
+ const DefaultCouchDBImage = "hyperledger/fabric-couchdb:latest"
46
26
47
27
// CouchDB manages the execution of an instance of a dockerized CounchDB
48
28
// for tests.
@@ -70,7 +50,7 @@ type CouchDB struct {
70
50
// Run runs a CouchDB container. It implements the ifrit.Runner interface
71
51
func (c * CouchDB ) Run (sigCh <- chan os.Signal , ready chan <- struct {}) error {
72
52
if c .Image == "" {
73
- c .Image = DefaultImage
53
+ c .Image = DefaultCouchDBImage
74
54
}
75
55
76
56
if c .Name == "" {
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright IBM Corp. All Rights Reserved.
3
+
4
+ SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ package runner
8
+
9
+ import (
10
+ "encoding/base32"
11
+ "time"
12
+
13
+ "github.com/hyperledger/fabric/common/util"
14
+ )
15
+
16
+ const DefaultStartTimeout = 30 * time .Second
17
+
18
+ // DefaultNamer is the default naming function.
19
+ var DefaultNamer NameFunc = UniqueName
20
+
21
+ // A NameFunc is used to generate container names.
22
+ type NameFunc func () string
23
+
24
+ // UniqueName is a NamerFunc that generates base-32 enocded UUIDs for container names.
25
+ func UniqueName () string {
26
+ return base32 .StdEncoding .WithPadding (base32 .NoPadding ).EncodeToString (util .GenerateBytesUUID ())
27
+ }
You can’t perform that action at this time.
0 commit comments