Specify package epoch on RH-like platforms to ensure proper upgrade path
MODIFY
libraries/recipe_helpers.rb
libraries/recipe_helpers.rb
@@ -18,10 +18,8 @@ class Chef
dd_agent_version = dd_agent_version[platform_family]
end
if !dd_agent_version.nil? && dd_agent_version.match(/^[0-9]+\.[0-9]+\.[0-9]+((?:~|-)[^0-9\s-]+[^-\s]*)?$/)
- if node['platform_family'] == 'suse' || node['platform_family'] == 'debian'
+ if %w[debian amazon fedora rhel suse].include?(node['platform_family'])
dd_agent_version = '1:' + dd_agent_version + '-1'
- elsif node['platform_family'] == 'rhel' || node['platform_family'] == 'fedora' || node['platform_family'] == 'amazon'
- dd_agent_version += '-1'
end
end
dd_agent_version

MODIFY
spec/dd-agent_spec.rb
spec/dd-agent_spec.rb
@@ -1446,7 +1446,7 @@ describe 'datadog::dd-agent' do
end.converge described_recipe
end
it 'installs the full version' do
- expect(chef_run).to install_dnf_package('datadog-agent').with_version('6.16.0-1')
+ expect(chef_run).to install_dnf_package('datadog-agent').with_version('1:6.16.0-1')
end
end
end

Specify package epoch on RH-like platforms to ensure proper upgrade path (#839)