From: Nicolas Peugnet <nicolas@club1.fr>
Date: Fri, 20 Mar 2026 16:20:30 +0100
Subject: Update deprecated Moby type NetworkListOptions

This type has been deprecated since Moby v27 (see: [f78dac3]) and
removed in Moby v28.

[f78dac3]: https://github.com/moby/moby/commit/f78dac35e596924f131e32f44cfd73455cdd6bed

This fixes the following build issue with Moby v28:

 # github.com/prometheus/prometheus/discovery/moby
 src/github.com/prometheus/prometheus/discovery/moby/network.go:37:49: undefined: types.NetworkListOptions
---
 discovery/moby/network.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/discovery/moby/network.go b/discovery/moby/network.go
index 794d2e6..ea1ca66 100644
--- a/discovery/moby/network.go
+++ b/discovery/moby/network.go
@@ -17,7 +17,7 @@ import (
 	"context"
 	"strconv"
 
-	"github.com/docker/docker/api/types"
+	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/client"
 
 	"github.com/prometheus/prometheus/util/strutil"
@@ -34,7 +34,7 @@ const (
 )
 
 func getNetworksLabels(ctx context.Context, client *client.Client, labelPrefix string) (map[string]map[string]string, error) {
-	networks, err := client.NetworkList(ctx, types.NetworkListOptions{})
+	networks, err := client.NetworkList(ctx, network.ListOptions{})
 	if err != nil {
 		return nil, err
 	}
