states.go 553 B

1234567891011121314151617181920
  1. package network
  2. import (
  3. "context"
  4. "github.com/docker/docker/api/types"
  5. "github.com/docker/docker/client"
  6. "gotest.tools/v3/poll"
  7. )
  8. // IsRemoved verifies the network is removed.
  9. func IsRemoved(ctx context.Context, client client.NetworkAPIClient, networkID string) func(log poll.LogT) poll.Result {
  10. return func(log poll.LogT) poll.Result {
  11. _, err := client.NetworkInspect(ctx, networkID, types.NetworkInspectOptions{})
  12. if err == nil {
  13. return poll.Continue("waiting for network %s to be removed", networkID)
  14. }
  15. return poll.Success()
  16. }
  17. }