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

(PE-11531) Fix upgrade issue with dev builds #113

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
13 changes: 10 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@
fail("invalid version ${package_version} requested")
}

$aio_upgrade_required = ($is_pe == false and $package_version != undef) or
($::aio_agent_version != undef and $package_version != undef and
versioncmp("${::aio_agent_version}", "${package_version}") < 0)
# Strip git sha from dev builds
if $package_version != undef and $package_version =~ /g/ {
$_expected_package_version = split($package_version, /[.-]g.*/)[0]
} else {
$_expected_package_version = $package_version
}

$aio_upgrade_required = ($is_pe == false and $_expected_package_version != undef) or
($::aio_agent_version != undef and $_expected_package_version != undef and
versioncmp("${::aio_agent_version}", "${_expected_package_version}") < 0)

if $::architecture == 'x86' and $arch == 'x64' {
fail('Unable to install x64 on a x86 system')
Expand Down
13 changes: 13 additions & 0 deletions spec/classes/puppet_agent_osfamily_solaris_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,19 @@

it { is_expected.not_to contain_transition("remove puppet-agent") }
end

context 'with up-to-date aio_agent_version missing git sha' do
let(:facts) do
facts.merge({
:is_pe => true,
:platform_tag => "solaris-10-i386",
:operatingsystemmajrelease => '10',
:aio_agent_version => '1.2.5.90',
})
end

it { is_expected.not_to contain_transition("remove puppet-agent") }
end
end

it do
Expand Down
15 changes: 14 additions & 1 deletion spec/classes/puppet_agent_windows_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,23 @@
:aio_agent_version => package_version
})}

it { is_expected.not_to contain_class('puppet_agent::windows::install') }
it { is_expected.not_to contain_file('c:\tmp\install_puppet.bat') }
end

context 'with equal package_version containing git sha' do
let(:facts) { facts.merge({
:is_pe => true,
:aio_agent_version => package_version
})}

let(:params) {
global_params.merge(:package_version => "#{package_version}.g886c5ab")
}

it { is_expected.not_to contain_file('c:\tmp\install_puppet.bat') }
it { is_expected.not_to contain_exec('install_puppet.bat') }
end

context 'with out of date aio_agent_version' do
let(:facts) { facts.merge({
:is_pe => true,
Expand Down