diff --git a/internal/machine/store/store.go b/internal/machine/store/store.go index abdcbfdc..8bb7ff30 100644 --- a/internal/machine/store/store.go +++ b/internal/machine/store/store.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "google.golang.org/protobuf/encoding/protojson" + "log/slog" "uncloud/internal/corrosion" "uncloud/internal/machine/api/pb" ) @@ -77,6 +78,10 @@ func (s *Store) ListMachines(ctx context.Context) ([]*pb.MachineInfo, error) { if err = protojson.Unmarshal([]byte(mJSON), &m); err != nil { return nil, fmt.Errorf("unmarshal machine info: %w", err) } + if err = m.Network.Validate(); err != nil { + slog.Error("Invalid network configuration for machine in store", "id", m.Id, "error", err) + continue + } machines = append(machines, &m) } return machines, nil