Skip to content

Commit e90ca49

Browse files
authored
Merge pull request #44 from danielparks/pdk-update
PDK update.
2 parents 6c34246 + f2fa69d commit e90ca49

7 files changed

+55
-37
lines changed

.puppet-lint.rc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
--fail-on-warnings
12
--relative
3+
--no-80chars-check
4+
--no-140chars-check
5+
--no-class_inherits_from_params_class-check
6+
--no-autoloader_layout-check
7+
--no-documentation-check
8+
--no-single_quote_string_with_variables-check
9+
--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ group :development do
3838
end
3939
group :development, :release_prep do
4040
gem "puppet-strings", '~> 4.0', require: false
41-
gem "puppetlabs_spec_helper", '~> 7.0', require: false
41+
gem "puppetlabs_spec_helper", '~> 8.0', require: false
42+
gem "puppet-blacksmith", '~> 7.0', require: false
4243
end
4344
group :system_tests do
4445
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]

Rakefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ require 'puppet-syntax/tasks/puppet-syntax'
77
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
88

99
PuppetLint.configuration.send('disable_relative')
10+
PuppetLint.configuration.send('disable_80chars')
11+
PuppetLint.configuration.send('disable_140chars')
12+
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
13+
PuppetLint.configuration.send('disable_autoloader_layout')
14+
PuppetLint.configuration.send('disable_documentation')
15+
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
16+
PuppetLint.configuration.fail_on_warnings = true
17+
PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"]
18+

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"go",
8484
"golang"
8585
],
86-
"pdk-version": "3.2.0",
86+
"pdk-version": "3.3.0",
8787
"template-url": "https://github.com/danielparks/pdk-templates#main",
88-
"template-ref": "heads/main-0-g49046f1"
88+
"template-ref": "heads/main-0-g918ea5f"
8989
}

spec/acceptance/golang_from_tarball_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
describe 'defined type golang::from_tarball' do
1111
context 'repeated root installs:' do
12-
context 'default ensure with 1.10.4 source' do
12+
context 'default ensure with gopher-owned source' do
1313
it 'installs Go' do
1414
idempotent_apply(<<~"PUPPET")
1515
golang::from_tarball { '/opt/go':
@@ -42,7 +42,7 @@
4242
end
4343
end
4444

45-
context 'ensure => present' do
45+
context 'ensure => present with gopher-owned source' do
4646
it 'causes no changes' do
4747
apply_manifest(<<~"PUPPET", catch_changes: true)
4848
golang::from_tarball { '/opt/go':
@@ -133,7 +133,7 @@
133133
end
134134

135135
context 'as a non-root user' do
136-
context 'default ensure with 1.10.4 source' do
136+
context 'default ensure with gopher-owned source' do
137137
it 'installs Go' do
138138
idempotent_apply(<<~"PUPPET")
139139
group { 'user': }

spec/acceptance/golang_installation_spec.rb

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
describe 'defined type golang::installation' do
66
context 'repeated root installs:' do
7-
context "ensure => '1.10.4'" do
7+
context "ensure => '1.22.9'" do
88
it 'installs Go' do
99
idempotent_apply(<<~'PUPPET')
1010
golang::installation { '/opt/go':
11-
ensure => '1.10.4',
11+
ensure => '1.22.9',
1212
}
1313
PUPPET
1414
end
1515

1616
describe command('/opt/go/bin/go version') do
17-
its(:stdout) { is_expected.to start_with('go version go1.10.4 ') }
17+
its(:stdout) { is_expected.to start_with('go version go1.22.9 ') }
1818
its(:stderr) { is_expected.to eq '' }
1919
its(:exit_status) { is_expected.to eq 0 }
2020
end
@@ -30,7 +30,7 @@
3030
end
3131

3232
describe command('/opt/go/bin/go version') do
33-
its(:stdout) { is_expected.to start_with('go version go1.10.4 ') }
33+
its(:stdout) { is_expected.to start_with('go version go1.22.9 ') }
3434
its(:stderr) { is_expected.to eq '' }
3535
its(:exit_status) { is_expected.to eq 0 }
3636
end
@@ -93,8 +93,8 @@
9393
context 'multiple root installs with linked_binaries' do
9494
it do
9595
idempotent_apply(<<~'PUPPET')
96-
golang::installation { '/opt/go1.10.4':
97-
ensure => '1.10.4',
96+
golang::installation { '/opt/go1.22.9':
97+
ensure => '1.22.9',
9898
}
9999
golang::installation { '/opt/go1.19.1':
100100
ensure => '1.19.1',
@@ -105,7 +105,7 @@
105105
PUPPET
106106
end
107107

108-
['1.10.4', '1.19.1'].each do |version|
108+
['1.22.9', '1.19.1'].each do |version|
109109
describe file("/opt/go#{version}") do
110110
it { is_expected.to be_directory }
111111
its(:owner) { is_expected.to eq 'root' }
@@ -140,19 +140,19 @@
140140
context 'multiple root installs with mixed ensure and linked_binaries' do
141141
it do
142142
idempotent_apply(<<~'PUPPET')
143-
golang::installation { '/opt/go1.10.4':
144-
ensure => '1.10.4',
143+
golang::installation { '/opt/go1.22.9':
144+
ensure => '1.22.9',
145145
}
146146
golang::installation { '/opt/go1.19.1':
147147
ensure => absent,
148148
}
149-
golang::linked_binaries { '/opt/go1.10.4':
149+
golang::linked_binaries { '/opt/go1.22.9':
150150
into_bin => '/usr/local/bin',
151151
}
152152
PUPPET
153153
end
154154

155-
describe file('/opt/go1.10.4/bin/go') do
155+
describe file('/opt/go1.22.9/bin/go') do
156156
it { is_expected.to be_file }
157157
it { is_expected.to be_executable }
158158
its(:owner) { is_expected.to eq 'root' }
@@ -164,11 +164,11 @@
164164

165165
describe file('/usr/local/bin/go') do
166166
it { is_expected.to be_symlink }
167-
it { is_expected.to be_linked_to '/opt/go1.10.4/bin/go' }
167+
it { is_expected.to be_linked_to '/opt/go1.22.9/bin/go' }
168168
end
169169

170170
describe command('/usr/local/bin/go version') do
171-
its(:stdout) { is_expected.to start_with('go version go1.10.4 ') }
171+
its(:stdout) { is_expected.to start_with('go version go1.22.9 ') }
172172
its(:stderr) { is_expected.to eq '' }
173173
its(:exit_status) { is_expected.to eq 0 }
174174
end
@@ -177,20 +177,20 @@
177177
context 'multiple root uninstalls with linked_binaries' do
178178
it do
179179
idempotent_apply(<<~'PUPPET')
180-
golang::installation { '/opt/go1.10.4':
180+
golang::installation { '/opt/go1.22.9':
181181
ensure => absent,
182182
}
183183
golang::installation { '/opt/go1.19.1':
184184
ensure => absent,
185185
}
186-
golang::linked_binaries { '/opt/go1.10.4':
186+
golang::linked_binaries { '/opt/go1.22.9':
187187
ensure => absent,
188188
into_bin => '/usr/local/bin',
189189
}
190190
PUPPET
191191
end
192192

193-
describe file('/opt/go1.10.4') do
193+
describe file('/opt/go1.22.9') do
194194
it { is_expected.not_to exist }
195195
end
196196

@@ -206,8 +206,8 @@
206206
context 'multiple user installs with linked_binaries' do
207207
it do
208208
idempotent_apply(<<~"PUPPET")
209-
golang::installation { '#{home}/user/go1.10.4':
210-
ensure => '1.10.4',
209+
golang::installation { '#{home}/user/go1.22.9':
210+
ensure => '1.22.9',
211211
owner => 'user',
212212
group => 'user',
213213
mode => '0700',
@@ -240,7 +240,7 @@
240240
PUPPET
241241
end
242242

243-
['1.10.4', '1.19.1'].each do |version|
243+
['1.22.9', '1.19.1'].each do |version|
244244
describe file("#{home}/user/go#{version}") do
245245
it { is_expected.to be_directory }
246246
its(:owner) { is_expected.to eq 'user' }
@@ -279,28 +279,28 @@
279279
context 'multiple user installs with mixed ensure and linked_binaries' do
280280
it do
281281
idempotent_apply(<<~"PUPPET")
282-
golang::installation { '#{home}/user/go1.10.4':
283-
ensure => '1.10.4',
282+
golang::installation { '#{home}/user/go1.22.9':
283+
ensure => '1.22.9',
284284
owner => 'user',
285285
group => 'user',
286286
}
287287
golang::installation { '#{home}/user/go1.19.1':
288288
ensure => absent,
289289
}
290-
golang::linked_binaries { '#{home}/user/go1.10.4':
290+
golang::linked_binaries { '#{home}/user/go1.22.9':
291291
into_bin => '#{home}/user/bin',
292292
}
293293
PUPPET
294294
end
295295

296-
describe file("#{home}/user/go1.10.4") do
296+
describe file("#{home}/user/go1.22.9") do
297297
it { is_expected.to be_directory }
298298
its(:owner) { is_expected.to eq 'user' }
299299
its(:group) { is_expected.to eq 'user' }
300300
it { is_expected.to be_mode 755 } # WTF converted to octal
301301
end
302302

303-
describe file("#{home}/user/go1.10.4/bin/go") do
303+
describe file("#{home}/user/go1.22.9/bin/go") do
304304
it { is_expected.to be_file }
305305
its(:owner) { is_expected.to eq 'user' }
306306
its(:group) { is_expected.to eq 'user' }
@@ -313,11 +313,11 @@
313313

314314
describe file("#{home}/user/bin/go") do
315315
it { is_expected.to be_symlink }
316-
it { is_expected.to be_linked_to "#{home}/user/go1.10.4/bin/go" }
316+
it { is_expected.to be_linked_to "#{home}/user/go1.22.9/bin/go" }
317317
end
318318

319319
describe command("#{home}/user/bin/go version") do
320-
its(:stdout) { is_expected.to start_with('go version go1.10.4 ') }
320+
its(:stdout) { is_expected.to start_with('go version go1.22.9 ') }
321321
its(:stderr) { is_expected.to eq '' }
322322
its(:exit_status) { is_expected.to eq 0 }
323323
end
@@ -326,7 +326,7 @@
326326
context 'multiple user uninstalls with linked_binaries' do
327327
it do
328328
idempotent_apply(<<~"PUPPET")
329-
golang::installation { '#{home}/user/go1.10.4':
329+
golang::installation { '#{home}/user/go1.22.9':
330330
ensure => absent,
331331
owner => 'user',
332332
group => 'user',
@@ -336,14 +336,14 @@
336336
owner => 'user',
337337
group => 'user',
338338
}
339-
golang::linked_binaries { '#{home}/user/go1.10.4':
339+
golang::linked_binaries { '#{home}/user/go1.22.9':
340340
ensure => absent,
341341
into_bin => '#{home}/user/bin',
342342
}
343343
PUPPET
344344
end
345345

346-
describe file("#{home}/user/go1.10.4") do
346+
describe file("#{home}/user/go1.22.9") do
347347
it { is_expected.not_to exist }
348348
end
349349

spec/acceptance/golang_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
it do
4141
idempotent_apply(<<~'END')
4242
class { 'golang':
43-
ensure => '1.10.4',
43+
ensure => '1.22.9',
4444
}
4545
END
4646
end
@@ -69,7 +69,7 @@ class { 'golang':
6969
end
7070

7171
describe command('/usr/local/bin/go version') do
72-
its(:stdout) { is_expected.to start_with('go version go1.10.4 ') }
72+
its(:stdout) { is_expected.to start_with('go version go1.22.9 ') }
7373
its(:stderr) { is_expected.to eq '' }
7474
its(:exit_status) { is_expected.to eq 0 }
7575
end

0 commit comments

Comments
 (0)