diff --git a/libraries/docker_swarm_service.rb b/libraries/docker_swarm_service.rb index 2534f4d828..5324c6b190 100644 --- a/libraries/docker_swarm_service.rb +++ b/libraries/docker_swarm_service.rb @@ -13,7 +13,8 @@ class DockerSwarmService < DockerSwarmBase property :image, String, required: true property :user, String, required: true, default: 'root' - property :networks, NonEmptyArray, required: true + property :networks, [Array, nil], required: true, + coerce: proc { |v| Array(v).empty? ? nil : Array(v) } property :hostname, String property :environment, Hash, default: {}