Skip to content
Snippets Groups Projects
Commit 0b7bc46b authored by Andrejs Cunskis's avatar Andrejs Cunskis
Browse files

Merge branch 'jmd-update-docker-inspect-commands-to-avoid-errors' into 'master'

Replace docker inspect with list filter

See merge request gitlab-org/gitlab-qa!1013
parents 443f733a 7ec80da1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -119,19 +119,11 @@ module Gitlab
end
 
def container_exists?(name)
Docker::Command.execute("container inspect #{name}")
rescue Docker::Shellout::StatusError
false
else
true
!Docker::Command.execute("container list --all --format '{{.Names}}' --filter name=^#{name}$").empty?
end
 
def network_exists?(name)
Docker::Command.execute("network inspect #{name}")
rescue Docker::Shellout::StatusError
false
else
true
!Docker::Command.execute("network list --format '{{.Name}}' --filter name=^#{name}$").empty?
end
 
def network_create(name)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment