mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
20 lines
518 B
Go
20 lines
518 B
Go
package network
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/moby/moby/client"
|
|
"gotest.tools/v3/poll"
|
|
)
|
|
|
|
// IsRemoved verifies the network is removed.
|
|
func IsRemoved(ctx context.Context, apiClient client.NetworkAPIClient, networkID string) func(log poll.LogT) poll.Result {
|
|
return func(log poll.LogT) poll.Result {
|
|
_, err := apiClient.NetworkInspect(ctx, networkID, client.NetworkInspectOptions{})
|
|
if err == nil {
|
|
return poll.Continue("waiting for network %s to be removed", networkID)
|
|
}
|
|
return poll.Success()
|
|
}
|
|
}
|