Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issues with go report #1081

Merged
merged 1 commit into from
Apr 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}