diff --git a/isolate/mtn.go b/isolate/mtn.go index 0e8954a..0eb1370 100644 --- a/isolate/mtn.go +++ b/isolate/mtn.go @@ -217,6 +217,9 @@ func (c *MtnState) RequestAllocs(ctx context.Context, netid string) (map[string] } func (c *MtnState) BindAllocs(ctx context.Context, netId string) error { + if len(netId) == 0 { + return fmt.Errorf("Len(netId) is zero.") + } c.Lock() log.G(ctx).Debugf("BindAllocs() called with netId %s.", netId) defer c.Unlock() diff --git a/isolate/porto/box.go b/isolate/porto/box.go index 72099c3..709e388 100644 --- a/isolate/porto/box.go +++ b/isolate/porto/box.go @@ -503,7 +503,7 @@ func (b *Box) Spool(ctx context.Context, name string, opts isolate.RawProfile) ( // NOTE: Not so fast, but it's important for debug journalContent.Set(b.journal.String()) - if b.GlobalState.Mtn.Cfg.Enable { + if b.GlobalState.Mtn.Cfg.Enable && profile.Network["mtn"] == "enable" { err := b.GlobalState.Mtn.BindAllocs(ctx, profile.Network["netid"]) if err != nil { return fmt.Errorf("Cant bind mtn alllocaton at spool with profile: %s, and with state: %s, and error: %s", profile, b.GlobalState.Mtn, err)