mirror of https://github.com/docker/buildx.git
Merge pull request #1732 from milas/builder-init-panic
builder: extra init error handling
This commit is contained in:
commit
e14e0521cf
|
@ -108,7 +108,7 @@ func New(dockerCli command.Cli, opts ...Option) (_ *Builder, err error) {
|
|||
|
||||
// Validate validates builder context
|
||||
func (b *Builder) Validate() error {
|
||||
if b.NodeGroup.DockerContext {
|
||||
if b.NodeGroup != nil && b.NodeGroup.DockerContext {
|
||||
list, err := b.opts.dockerCli.ContextStore().List()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -61,7 +61,10 @@ func GetCurrentInstance(txn *store.Txn, dockerCli command.Cli) (*store.NodeGroup
|
|||
return nil, err
|
||||
}
|
||||
if ng == nil {
|
||||
ng, _ = GetNodeGroup(txn, dockerCli, dockerCli.CurrentContext())
|
||||
ng, err = GetNodeGroup(txn, dockerCli, dockerCli.CurrentContext())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return ng, nil
|
||||
|
|
Loading…
Reference in New Issue