Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve CI errors #8

Merged
merged 14 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
- rocky-linux-8
- rhel-8
- rhel-7
- sles-12
# disabled until CINC supports sles-12
#- sles-12
- sles-15
- opensuse-leap

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
agent_type:
- ops-agent
version:
- "2.0.1"
- "2.0.3"
- latest
# distro is the platform name in kitchen.yml
distro:
Expand All @@ -43,9 +43,6 @@ jobs:
- windows-20h2-core
- windows-2004-core

exclude:
# invalid combos

steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
5 changes: 4 additions & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ driver:
# https://www.googleapis.com/auth/monitoring
- monitoring
machine_type: "e2-medium"
preemptible: true
auto_migrate: true
disks:
disk0:
disk_type: pd-ssd
Expand All @@ -109,6 +109,9 @@ verifier:
name: inspec

transport:
connection_timeout: 10
connection_retries: 10
max_ssh_sessions: 1
# this username needs to match the user specified in the ssh keypair
username: <%= ENV['CHEF_SSH_USER'] %>
ssh_key:
Expand Down
2 changes: 1 addition & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
end
else
# Failure due to incorrect file type
Chef::Log.fatal('The `main_config` attribute was set to an invalid value. It must either be a Chef template or a file ending in .yaml')
Chef::Log.fatal('The `main_config` attribute was set to an invalid value. It must either be a Chef template or a file ending in .yaml or .conf')
end
end

Expand Down
16 changes: 9 additions & 7 deletions resources/google_cloud_ops_agents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,15 @@
svc_file = '/etc/rc.d/init.d/google-fluentd'
unit_file = '/run/systemd/generator.late/google-fluentd.service'
end
file svc_file do
action :delete
only_if { ::File.exist?(svc_file) }
end
file unit_file do
action :delete
only_if { ::File.exist?(unit_file) }
unless svc_file.nil? || unit_file.nil?
file svc_file do
action :delete
only_if { ::File.exist?(svc_file) }
end
file unit_file do
action :delete
only_if { ::File.exist?(unit_file) }
end
end
when 'windows'
powershell_script node['file_url_name'] do
Expand Down
4 changes: 2 additions & 2 deletions test/integration/linux/logging/latest/default_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if node['main_config'] != ''
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('sha256sum') { should eq '5b1802dc6a8f52f6e4e8de4ce30615e8b9076c92b31c60a11db8d0ea6bd5e6f2' }
its('sha256sum') { should eq '633492a8b40166009a06c7a495df2f08c24ed6c050554e67827e368ba27b6d4c' }
end
end
end
Expand All @@ -48,6 +48,6 @@
it { should exist }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('sha256sum') { should eq '505623beffaac642dfa172f63ed68af72275b50a44760501a3ef62224bcd59a5' }
its('sha256sum') { should eq '203773873a0bccc50d2bc52a1dec9231a39c0d2091ef6c5f2875b82a5be68354' }
end
end
4 changes: 2 additions & 2 deletions test/integration/linux/monitoring/latest/default_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if node['main_config'] != ''
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('sha256sum') { should eq '3728ed856744b0ac9afd78081e3147aec6f1f198d3a9307c43ed4beee0f9d188' }
its('sha256sum') { should eq '14050e7ae0d30867a005007e015b9a9ab570f74a15fa6ccbaae4e4707195495c' }
end
end
end
Expand All @@ -48,6 +48,6 @@
it { should exist }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('sha256sum') { should eq '8b68d474a8115aab18e61eb877a7c8a16715cd8346c98c9d645ef0813fbcb02f' }
its('sha256sum') { should eq 'c05d2f664052abaaadb1b1baa9807fa6fd3c2ed9b419575671c911ecb7d3dd3c' }
end
end
2 changes: 1 addition & 1 deletion test/integration/linux/ops-agent/2.0.1/default_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if node['main_config'] != ''
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('sha256sum') { should eq '802e5adb76188c88a7192dba0b4f6cfc9d22437ae7c7d98639ccc56d08f48454' }
its('sha256sum') { should eq 'f360e2ac0984bf33f7e158263ce5ea68c363680af80237558173284f3b47f337' }
end
end
end
2 changes: 1 addition & 1 deletion test/integration/linux/ops-agent/latest/default_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
if node['main_config'] != ''
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('sha256sum') { should eq '802e5adb76188c88a7192dba0b4f6cfc9d22437ae7c7d98639ccc56d08f48454' }
its('sha256sum') { should eq 'f360e2ac0984bf33f7e158263ce5ea68c363680af80237558173284f3b47f337' }
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@
if node['package_state'] == 'present'
it { should exist }
its('sha256sum') { should eq 'a8dd6a4312fb2d62aa11bccd612182033fd1b378b9bc6da8eef25cee54b15dd3' }
else
it { should_not exist }
end
end
2 changes: 0 additions & 2 deletions test/integration/windows/ops-agent/latest/default_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,5 @@
if node['package_state'] == 'present'
it { should exist }
its('sha256sum') { should eq 'a8dd6a4312fb2d62aa11bccd612182033fd1b378b9bc6da8eef25cee54b15dd3' }
else
it { should_not exist }
end
end