mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Don't fail to start daemon if builder source is not available
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
692df4699c
commit
ca3e3fcf7e
1 changed files with 13 additions and 11 deletions
|
@ -37,6 +37,7 @@ import (
|
|||
digest "github.com/opencontainers/go-digest"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Opt defines a structure for creating a worker.
|
||||
|
@ -77,32 +78,33 @@ func NewWorker(opt Opt) (*Worker, error) {
|
|||
CacheAccessor: cm,
|
||||
MetadataStore: opt.MetadataStore,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if err == nil {
|
||||
sm.Register(gs)
|
||||
} else {
|
||||
logrus.Warnf("Could not register builder git source: %s", err)
|
||||
}
|
||||
|
||||
sm.Register(gs)
|
||||
|
||||
hs, err := http.NewSource(http.Opt{
|
||||
CacheAccessor: cm,
|
||||
MetadataStore: opt.MetadataStore,
|
||||
Transport: opt.Transport,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if err == nil {
|
||||
sm.Register(hs)
|
||||
} else {
|
||||
logrus.Warnf("Could not register builder http source: %s", err)
|
||||
}
|
||||
|
||||
sm.Register(hs)
|
||||
|
||||
ss, err := local.NewSource(local.Opt{
|
||||
SessionManager: opt.SessionManager,
|
||||
CacheAccessor: cm,
|
||||
MetadataStore: opt.MetadataStore,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if err == nil {
|
||||
sm.Register(ss)
|
||||
} else {
|
||||
logrus.Warnf("Could not register builder local source: %s", err)
|
||||
}
|
||||
sm.Register(ss)
|
||||
|
||||
return &Worker{
|
||||
Opt: opt,
|
||||
|
|
Loading…
Reference in a new issue