From fb4f26a48316ac9b00ede984b4fd6d3892197cee Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 19 Feb 2025 13:32:33 +0000 Subject: [PATCH] (CAT-2238) Update latest_template? check to compare version numbers Previously the code would check only if the given tag matched the shipped pdk-templates version number. With this change it will now also first check if the given tag is a version number and then if it is check if it is greater than the shipped number. --- lib/pdk/module/update.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pdk/module/update.rb b/lib/pdk/module/update.rb index 519cde6f3..3c1cad980 100644 --- a/lib/pdk/module/update.rb +++ b/lib/pdk/module/update.rb @@ -81,6 +81,8 @@ def pinned_to_puppetlabs_template_tag? private def latest_template? + return true if /^\d+\.\d+\.\d+(?:\.\d+)?$/.match?(template_uri.uri_fragment) && Gem::Version.new(template_uri.uri_fragment) > Gem::Version.new(PDK::TEMPLATE_REF) + [PDK::TEMPLATE_REF, 'master', 'main'].include?(template_uri.uri_fragment) end