From 466e14aa718a60ee28e3e877292b2b54bc26dfd5 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 11 May 2017 15:25:26 -0700 Subject: [PATCH] Move errors to plugin pkg Signed-off-by: Michael Crosby --- errors.go => plugin/errors.go | 2 +- services/execution/service.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename errors.go => plugin/errors.go (93%) diff --git a/errors.go b/plugin/errors.go similarity index 93% rename from errors.go rename to plugin/errors.go index 7610e1217..60d5203ee 100644 --- a/errors.go +++ b/plugin/errors.go @@ -1,4 +1,4 @@ -package containerd +package plugin import "errors" diff --git a/services/execution/service.go b/services/execution/service.go index 6652d43b0..884925247 100644 --- a/services/execution/service.go +++ b/services/execution/service.go @@ -84,7 +84,7 @@ func (s *Service) Create(ctx context.Context, r *api.CreateRequest) (*api.Create s.mu.Lock() if _, ok := s.containers[r.ID]; ok { s.mu.Unlock() - return nil, containerd.ErrContainerExists + return nil, plugin.ErrContainerExists } c, err := runtime.Create(ctx, r.ID, opts) if err != nil { @@ -286,7 +286,7 @@ func (s *Service) getContainer(id string) (plugin.Container, error) { c, ok := s.containers[id] s.mu.Unlock() if !ok { - return nil, containerd.ErrContainerNotExist + return nil, plugin.ErrContainerNotExist } return c, nil } @@ -294,7 +294,7 @@ func (s *Service) getContainer(id string) (plugin.Container, error) { func (s *Service) getRuntime(name string) (plugin.Runtime, error) { runtime, ok := s.runtimes[name] if !ok { - return nil, containerd.ErrUnknownRuntime + return nil, plugin.ErrUnknownRuntime } return runtime, nil }