runtime: minor fixes for local runtime (#2019)
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// defaultNamespace to use if not provided as an option
|
// defaultNamespace to use if not provided as an option
|
||||||
const defaultNamespace = "default"
|
const defaultNamespace = "micro"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// The directory for logs to be output
|
// The directory for logs to be output
|
||||||
@@ -313,7 +313,7 @@ func (r *localRuntime) Create(s *runtime.Service, opts ...runtime.CreateOption)
|
|||||||
r.namespaces[options.Namespace] = make(map[string]*service)
|
r.namespaces[options.Namespace] = make(map[string]*service)
|
||||||
}
|
}
|
||||||
if _, ok := r.namespaces[options.Namespace][serviceKey(s)]; ok {
|
if _, ok := r.namespaces[options.Namespace][serviceKey(s)]; ok {
|
||||||
return errors.New("service already running")
|
return runtime.ErrAlreadyExists
|
||||||
}
|
}
|
||||||
|
|
||||||
// create new service
|
// create new service
|
||||||
|
@@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
ErrAlreadyExists = errors.New("already exists")
|
ErrAlreadyExists = errors.New("already exists")
|
||||||
|
ErrNotFound = errors.New("not found")
|
||||||
)
|
)
|
||||||
|
|
||||||
// Runtime is a service runtime manager
|
// Runtime is a service runtime manager
|
||||||
|
Reference in New Issue
Block a user