Merge pull request #9363 from 42wim/fixcni

cni: use correct interface for netStatus
This commit is contained in:
Nick Ethier 2020-11-17 12:03:39 -05:00 committed by GitHub
commit b84273fd93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -112,7 +112,9 @@ func (c *cniNetworkConfigurator) Setup(ctx context.Context, alloc *structs.Alloc
if len(res.Interfaces) > 0 {
iface, name := func(r *cni.CNIResult) (*cni.Config, string) {
for i := range r.Interfaces {
return r.Interfaces[i], i
if r.Interfaces[i].Sandbox != "" {
return r.Interfaces[i], i
}
}
return nil, ""
}(res)