Skip to content

Commit 3db6640

Browse files
committed
Remove validation of MySQL packages version on Ubuntu 18.04/20.04 ARM as they are installed from OS repos.
Signed-off-by: Giacomo Marciani <[email protected]>
1 parent 5e43cc1 commit 3db6640

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

attributes/default.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,8 @@
277277
}
278278
)
279279
default['cluster']['mysql']['repository']['expected']['version'] = value_for_platform(
280-
'default' => "8.0.31",
281-
'ubuntu' => {
282-
'20.04' => "8.0.30-0ubuntu0.20.04.2",
283-
'18.04' => "5.7.39-0ubuntu0.18.04.2",
284-
}
280+
'default' => "8.0.31"
281+
# Ubuntu 18.04/20.04 ARM: MySQL packages are installed from OS repo and we do not assert on a specific version.
285282
)
286283
else
287284
default['cluster']['mysql']['repository']['packages'] = value_for_platform(

cookbooks/aws-parallelcluster-install/recipes/install_mysql_client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
mysql_archive_url = node['cluster']['mysql']['package']['archive']
3131
mysql_tar_file = "/tmp/#{node['cluster']['mysql']['package']['file-name']}"
3232

33+
log "Downloading MySQL packages archive from #{mysql_archive_url}"
34+
3335
remote_file mysql_tar_file do
3436
source mysql_archive_url
3537
mode '0644'

cookbooks/aws-parallelcluster-test/libraries/helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ def validate_package_source(package, expected_source)
263263
def validate_package_version(package, expected_version)
264264
case node['platform']
265265
when 'amazon', 'centos'
266-
test_expression = "$(yum info #{package} | grep 'Version' | awk '{print $3}')"
266+
test_expression = "$(yum info installed #{package} | grep 'Version' | awk '{print $3}')"
267267
when 'ubuntu'
268-
test_expression = "$(apt show #{package} | grep 'Version:' | awk '{print $2}')"
268+
test_expression = "$(apt list --installed #{package} | awk '{print $2}')"
269269
else
270270
raise "Platform not supported: #{node['platform']}"
271271
end

cookbooks/aws-parallelcluster-test/recipes/validate_mysql.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#
1919
# Check the repository source of a package
2020
#
21-
Chef::Log.info("Checking for MySql implementation on #{node['platform']}:#{node['kernel']['machine']}")
22-
node['cluster']['mysql']['repository']['packages'].each do |pkg|
23-
validate_package_version(pkg, node['cluster']['mysql']['repository']['expected']['version'])
21+
unless platform?('ubuntu') && arm_instance?
22+
Chef::Log.info("Checking for MySql implementation on #{node['platform']}:#{node['kernel']['machine']}")
23+
node['cluster']['mysql']['repository']['packages'].each do |pkg|
24+
validate_package_version(pkg, node['cluster']['mysql']['repository']['expected']['version'])
25+
end
2426
end

0 commit comments

Comments
 (0)