Skip to content

Commit bf1057c

Browse files
authored
Merge branch 'master' into 1.2.0
2 parents 43ba7fd + 6acc559 commit bf1057c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1947
-354
lines changed

.fixtures.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ fixtures:
33
stdlib: 'puppetlabs-stdlib'
44
apt: 'puppetlabs-apt'
55
translate: 'puppetlabs-translate'
6+
powershell: 'puppetlabs-powershell'
7+
reboot: 'puppetlabs-reboot'
68
symlinks:
7-
docker: "#{source_dir}"
9+
docker: "#{source_dir}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ doc
1111
log
1212
Gemfile.lock
1313
coverage/*
14+
/vendor/

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ RSpec/BeforeAfterAll:
2323
A necessary evil in acceptance testing.
2424
Exclude:
2525
- spec/acceptance/**/*.rb
26+
- spec/acceptance_swarm/**/*.rb
2627
RSpec/HookArgument:
2728
Description: Prefer explicit :each argument, matching existing module's style
2829
EnforcedStyle: each

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ bundler_args: --without development system_tests
44
before_install: rm Gemfile.lock || true
55
sudo: false
66
rvm:
7-
- 2.1.6
87
- 2.2.5
98
- 2.3.3
109
script:

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ run the integration tests against RHEL, CentOS and Debian.
8181
bundle exec rake acceptance:pooler:ubuntu-1404
8282
bundle exec rake acceptance:pooler:ubuntu-1604
8383
bundle exec rake acceptance:pooler:ubuntu-1610
84+
bundle exec rake acceptance:pooler:win-2016
8485
bundle exec rake acceptance:vagrant:centos-70-x64
8586
bundle exec rake acceptance:vagrant:debian-81-x64
8687
bundle exec rake acceptance:vagrant:ubuntu-1404-x64

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ end
3232
group :system_tests do
3333
gem "beaker-puppet_install_helper", :require => false
3434
gem "beaker-rspec"
35-
gem "beaker", "~> 2.0"
35+
gem "beaker", "~> 3.13"
3636
end
3737

3838
group :development do

Guardfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ group :acceptance do
1515
watch(%r{^spec\/acceptance\/.+\.rb$})
1616
end
1717
end
18+
19+
group :acceptance_swarm do
20+
guard :rake, :task => 'acceptance_swarm' do
21+
watch(%r{^spec\/acceptance_swarm\/.+\.rb$})
22+
end
23+
end

lib/facter/docker.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
require 'facter'
22
require 'json'
33

4+
docker_command = if Facter.value(:kernel) == 'windows'
5+
'powershell -c docker'
6+
else
7+
'docker'
8+
end
9+
410
def interfaces
511
Facter.value(:interfaces).split(',')
612
end
@@ -23,7 +29,7 @@ def interfaces
2329
setcode do
2430
if Facter::Util::Resolution.which('docker')
2531
value = Facter::Core::Execution.execute(
26-
"docker version --format '{{json .}}'",
32+
"#{docker_command} version --format '{{json .}}'",
2733
)
2834
val = JSON.parse(value)
2935
end
@@ -37,7 +43,7 @@ def interfaces
3743
if docker_version !~ %r{1[.][0-9][0-2]?[.]\w+}
3844
if Facter::Util::Resolution.which('docker')
3945
docker_json_str = Facter::Util::Resolution.exec(
40-
"docker info --format '{{json .}}'",
46+
"#{docker_command} info --format '{{json .}}'",
4147
)
4248
docker = JSON.parse(docker_json_str)
4349
docker['network'] = {}

lib/puppet/parser/functions/docker_run_flags.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ module Puppet::Parser::Functions
5757
if opts['read_only']
5858
flags << '--read-only=true'
5959
end
60+
params_join_char = Facter.value(:osfamily).casecmp('windows').zero? ? ' ' : " \\\n"
6061

6162
multi_flags = lambda { |values, format|
6263
filtered = [values].flatten.compact
63-
filtered.map { |val| sprintf(format + " \\\n", val) }
64+
filtered.map { |val| sprintf(format + params_join_char, val) }
6465
}
6566

6667
[
@@ -88,6 +89,6 @@ module Puppet::Parser::Functions
8889

8990
# Some software (inc systemd) will truncate very long lines using glibc's
9091
# max line length. Wrap options across multiple lines with '\' to avoid
91-
flags.flatten.join(" \\\n ")
92+
flags.flatten.join(params_join_char)
9293
end
9394
end

lib/puppet/parser/functions/docker_stack_flags.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ module Puppet::Parser::Functions
1616
flags << "--compose-file '#{opts['compose_file']}'"
1717
end
1818

19+
if opts['resolve_image'].to_s != 'undef'
20+
flags << "--resolve-image '#{opts['resolve_image']}'"
21+
end
22+
1923
if opts['prune'].to_s != 'undef'
2024
flags << "--prune '#{opts['prune']}'"
2125
end

0 commit comments

Comments
 (0)