Update swarmkit to return correct error-codes on conflicting names
This updates the swarmkit vendoring to the latest version in the bump_v18.09 branch Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: ad7105260f3c2ff32a375ff78dce9a96e01d87cb Component: engine
This commit is contained in:
@@ -130,7 +130,7 @@ github.com/containerd/ttrpc 2a805f71863501300ae1976d29f0454ae003e85a
|
||||
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
|
||||
|
||||
# cluster
|
||||
github.com/docker/swarmkit 6186e40fb04a7681e25a9101dbc7418c37ef0c8b # bump_v18.09 branch
|
||||
github.com/docker/swarmkit d61ff7666d7eba47137060c6c8fa8c29aa6198f5 # bump_v18.09 branch
|
||||
github.com/gogo/protobuf v1.0.0
|
||||
github.com/cloudflare/cfssl 1.3.2
|
||||
github.com/fernet/fernet-go 1b2437bc582b3cfbb341ee5a29f8ef5b42912ff2
|
||||
|
||||
Generated
Vendored
+12
-6
@@ -680,13 +680,14 @@ func (s *Server) CreateService(ctx context.Context, request *api.CreateServiceRe
|
||||
|
||||
return store.CreateService(tx, service)
|
||||
})
|
||||
if err != nil {
|
||||
switch err {
|
||||
case store.ErrNameConflict:
|
||||
return nil, status.Errorf(codes.AlreadyExists, "service %s already exists", request.Spec.Annotations.Name)
|
||||
case nil:
|
||||
return &api.CreateServiceResponse{Service: service}, nil
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &api.CreateServiceResponse{
|
||||
Service: service,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetService returns a Service given a ServiceID.
|
||||
@@ -896,7 +897,12 @@ func (s *Server) ListServices(ctx context.Context, request *api.ListServicesRequ
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
switch err {
|
||||
case store.ErrInvalidFindBy:
|
||||
return nil, status.Errorf(codes.InvalidArgument, err.Error())
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if request.Filters != nil {
|
||||
|
||||
Reference in New Issue
Block a user