Skip to content

Commit

Permalink
Merge pull request #1081 from FeO24/master
Browse files Browse the repository at this point in the history
fix: issues with go report
  • Loading branch information
allencloud authored Apr 10, 2018
2 parents 2bda9dc + 095d637 commit 30e9947
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ctrd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func NewClient(cfg Config) (APIClient, error) {
}

// Get will reture an available containerd grpc client,
// Or occured an error
// Or occurred an error
func (c *Client) Get(ctx context.Context) (*WrapperClient, error) {
start := time.Now()

Expand All @@ -106,7 +106,7 @@ func (c *Client) Get(ctx context.Context) (*WrapperClient, error) {
end := time.Now()
elapsed := end.Sub(start)
logrus.WithFields(logrus.Fields{
"elasped": elapsed,
"elapsed": elapsed,
}).Debug("Get a grpc client")

return wrapperCli, nil
Expand Down
6 changes: 1 addition & 5 deletions daemon/mgr/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ func (mgr *ImageManager) ListImages(ctx context.Context, filters string) ([]type
// SearchImages searches imaged from specified registry.
func (mgr *ImageManager) SearchImages(ctx context.Context, name string, registry string) ([]types.SearchResultItem, error) {
// Directly send API calls towards specified registry
if registry == "" {
registry = mgr.DefaultRegistry
}

return nil, nil
return nil, errtypes.ErrNotImplemented
}

// GetImage gets image by image id or ref.
Expand Down
4 changes: 4 additions & 0 deletions pkg/errtypes/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ var (

// ErrLockfailed represents that failed to lock.
ErrLockfailed = errorType{codeLockfailed, "lock failed"}

// ErrNotImplemented represents that the function is not implemented.
ErrNotImplemented = errorType{codeNotImplemented, "not implemented"}
)

const (
Expand All @@ -35,6 +38,7 @@ const (
codeInvalidType
codeTimeout
codeLockfailed
codeNotImplemented
)

type errorType struct {
Expand Down
3 changes: 3 additions & 0 deletions pkg/quota/prjquota.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func (quota *PrjQuota) SetDiskQuota(dir string, size string, quotaID int) error
}

limit, err := bytefmt.ToKilobytes(size)
if err != nil {
return fmt.Errorf("invalid size: %s %v", size, err)
}

// transfer limit from kbyte to byte
if err := quota.checkDevLimit(dir, limit*1024); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions test/environment/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
Subnet = "192.168.1.0/24"
)

// GetBusybox get image info from test envrionment variable.
// GetBusybox get image info from test environment variable.
func GetBusybox() {
if len(os.Getenv("POUCH_BUSYBOXREPO")) != 0 {
BusyboxRepo = os.Getenv("POUCH_BUSYBOXREPO")
Expand All @@ -52,7 +52,7 @@ func GetBusybox() {
}
}

// GetHelloWorld get image info from test envrionment variable.
// GetHelloWorld get image info from test environment variable.
func GetHelloWorld() {
if len(os.Getenv("POUCH_HELLOWORLDREPO")) != 0 {
HelloworldRepo = os.Getenv("POUCH_HELLOWORLDREPO")
Expand Down
1 change: 1 addition & 0 deletions test/util_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func PullImage(c *check.C, image string) {
q.Add("fromImage", image)
query := request.WithQuery(q)
resp, err = request.Post("/images/create", query)
c.Assert(err, check.IsNil)
c.Assert(resp.StatusCode, check.Equals, 200)
}
}

0 comments on commit 30e9947

Please sign in to comment.