Allow major.minor version in non-SemVer docker parents to be anywhere in tag
Change-Id: Idf036c594ac0eb9f38f6b8118f13485d9441aeea
diff --git a/jjb/shell/tagcollisionreject.sh b/jjb/shell/tagcollisionreject.sh
index 09c014c..7a2307a 100755
--- a/jjb/shell/tagcollisionreject.sh
+++ b/jjb/shell/tagcollisionreject.sh
@@ -100,9 +100,12 @@
if [[ "${p_version}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]
then
echo " OK: Parent '$p_image:$p_version' is a released SemVer version"
- elif [[ "${p_version}" =~ ^([0-9]+)\.([0-9]+).*$ ]]
+ elif [[ "${p_version}" =~ ^.*([0-9]+)\.([0-9]+).*$ ]]
then
- # handle the non-SemVer 'ubuntu:16.04' and 'postgres:10.3-alpine' cases
+ # handle non-SemVer versions that have a Major.Minor version specifier in the name
+ # 'ubuntu:16.04'
+ # 'postgres:10.3-alpine'
+ # 'openjdk:8-jre-alpine3.8'
echo " OK: Parent '$p_image:$p_version' is using a non-SemVer, but sufficient, version"
else
echo " ERROR: Parent '$p_image:$p_version' is NOT using an specific version"
diff --git a/jjb/shell/versiontag.sh b/jjb/shell/versiontag.sh
index 60042d8..96e8568 100755
--- a/jjb/shell/versiontag.sh
+++ b/jjb/shell/versiontag.sh
@@ -101,9 +101,12 @@
if [[ "${p_version}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]
then
echo " OK: Parent '$p_image:$p_version' is a released SemVer version"
- elif [[ "${p_version}" =~ ^([0-9]+)\.([0-9]+).*$ ]]
+ elif [[ "${p_version}" =~ ^.*([0-9]+)\.([0-9]+).*$ ]]
then
- # handle the non-SemVer 'ubuntu:16.04' and 'postgres:10.3-alpine' cases
+ # handle non-SemVer versions that have a Major.Minor version specifier in the name
+ # 'ubuntu:16.04'
+ # 'postgres:10.3-alpine'
+ # 'openjdk:8-jre-alpine3.8'
echo " OK: Parent '$p_image:$p_version' is using a non-SemVer, but sufficient, version"
else
echo " ERROR: Parent '$p_image:$p_version' is NOT using an specific version"