Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions internal/mcp/versioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
"log/slog"
"math"
"strings"
"time"
Expand Down Expand Up @@ -392,16 +391,18 @@ func (m *Manager) replaceContainerSnapshot(ctx context.Context, botID, container
// unconditionally so the next call dials fresh to the new process.
m.grpcPool.Remove(botID)

if netResult, err := m.service.SetupNetwork(ctx, ctr.NetworkSetupRequest{
netResult, err := m.service.SetupNetwork(ctx, ctr.NetworkSetupRequest{
ContainerID: containerID,
CNIBinDir: m.cfg.CNIBinaryDir,
CNIConfDir: m.cfg.CNIConfigDir,
}); err != nil {
m.logger.Warn("network setup failed after snapshot replace",
slog.String("container_id", containerID), slog.Any("error", err))
} else {
m.SetContainerIP(botID, netResult.IP)
})
if err != nil {
return fmt.Errorf("network setup after snapshot replace: %w", err)
}
if netResult.IP == "" {
return fmt.Errorf("network setup returned no IP after snapshot replace for %s", containerID)
}
m.SetContainerIP(botID, netResult.IP)
return nil
}

Expand Down