summaryrefslogtreecommitdiffstats
path: root/filter_plugins
diff options
context:
space:
mode:
authorJason DeTiberus <detiber@gmail.com>2016-04-25 16:20:10 -0400
committerJason DeTiberus <detiber@gmail.com>2016-04-25 16:20:10 -0400
commit47f50d5d1a7b4beb89479d9452b95e1c1030b8dc (patch)
tree18501f6ab11fbebd3c2189d9481f666d2b3c8cf0 /filter_plugins
parent4e01bd4a87088f53af309b36ce4da431888fcaf4 (diff)
parent337b9e4a842cfd7ec6705fd1501cc9c2991a694f (diff)
downloadopenshift-47f50d5d1a7b4beb89479d9452b95e1c1030b8dc.tar.gz
openshift-47f50d5d1a7b4beb89479d9452b95e1c1030b8dc.tar.bz2
openshift-47f50d5d1a7b4beb89479d9452b95e1c1030b8dc.tar.xz
openshift-47f50d5d1a7b4beb89479d9452b95e1c1030b8dc.zip
Merge pull request #1803 from sdodson/issue1800
Fix image version handling for v1.2.0-rc1
Diffstat (limited to 'filter_plugins')
-rw-r--r--filter_plugins/oo_filters.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index 3da4562ac..0f54d8a0a 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -820,15 +820,18 @@ class FilterModule(object):
def oo_image_tag_to_rpm_version(version, include_dash=False):
""" Convert an image tag string to an RPM version if necessary
Empty strings and strings that are already in rpm version format
- are ignored.
+ are ignored. Also remove non semantic version components.
Ex. v3.2.0.10 -> -3.2.0.10
+ v1.2.0-rc1 -> -1.2.0
"""
if not isinstance(version, basestring):
raise errors.AnsibleFilterError("|failed expects a string or unicode")
-
+ # TODO: Do we need to make this actually convert v1.2.0-rc1 into 1.2.0-0.rc1
+ # We'd need to be really strict about how we build the RPM Version+Release
if version.startswith("v"):
version = version.replace("v", "")
+ version = version.split('-')[0]
if include_dash:
version = "-" + version