From c5a25871eb5ffaee787ed3f5956b4eb8affbb82a Mon Sep 17 00:00:00 2001
From: Steve Milner <smilner@redhat.com>
Date: Thu, 24 Aug 2017 11:34:16 -0400
Subject: openshift_version: enterprise accepts new style pre-release

Example: v3.7.0-0.104.0

Resolves 5192
Fixes: https://github.com/openshift/openshift-ansible/issues/5192
---
 roles/openshift_version/tasks/main.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/roles/openshift_version/tasks/main.yml b/roles/openshift_version/tasks/main.yml
index a6b8a40c8..c0ea00f34 100644
--- a/roles/openshift_version/tasks/main.yml
+++ b/roles/openshift_version/tasks/main.yml
@@ -60,13 +60,16 @@
   # It also allows for optional trailing data which:
   # - must start with a dash
   # - may contain numbers
+  # - may containe dots (https://github.com/openshift/openshift-ansible/issues/5192)
+  #
   - name: (Enterprise) Verify openshift_image_tag is valid
     when: openshift.common.deployment_type == 'openshift-enterprise'
     assert:
       that:
-      - "{{ openshift_image_tag|match('(^v\\d+\\.\\d+[\\.\\d+]*(-\\d+)?$)') }}"
+      - "{{ openshift_image_tag|match('(^v\\d+\\.\\d+(\\.\\d+)*(-\\d+(\\.\\d+)*)?$)') }}"
       msg: |-
-        openshift_image_tag must be in the format v#.#[.#[.#]]. Examples: v1.2, v3.4.1, v3.5.1.3, v1.2-1, v1.2.3-4
+        openshift_image_tag must be in the format v#.#[.#[.#]]. Examples: v1.2, v3.4.1, v3.5.1.3,
+        v3.5.1.3.4, v1.2-1, v1.2.3-4, v1.2.3-4.5, v1.2.3-4.5.6
         You specified openshift_image_tag={{ openshift_image_tag }}
 
 # Make sure we copy this to a fact if given a var:
-- 
cgit v1.2.3