client/networking: wrap error message from CNI plugin (#6316)

This commit is contained in:
Tim Gross 2019-09-13 08:20:05 -04:00 committed by GitHub
parent e4e50abb02
commit a6ef8c5d42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,7 +163,7 @@ func (b *bridgeNetworkConfigurator) Setup(ctx context.Context, alloc *structs.Al
if _, err := b.cni.Setup(ctx, alloc.ID, spec.Path, cni.WithCapabilityPortMap(getPortMapping(alloc))); err != nil {
b.logger.Warn("failed to configure bridge network", "err", err, "attempt", attempt)
if attempt == retry {
return err
return fmt.Errorf("failed to configure bridge network: %v", err)
}
// Sleep for 1 second + jitter
time.Sleep(time.Second + (time.Duration(b.rand.Int63n(1000)) * time.Millisecond))