Beispiel #1
0
 def version_to_image_name(self, version: VersionT) -> ImageNameT:
     split_version = version.split('|')
     if len(split_version) > 2:
         raise ValueError(
             'Expected version formatted as '
             '<image tag>|<git hash>, got {}'.format(version), )
     return ImageNameT(version)
Beispiel #2
0
 def version_to_image_name(self, version: VersionT) -> ImageNameT:
     """
     Returns the image tag from the version string.
     (i.e) 0.3.68-1541626353-d1c29db1 -> d1c29db1
     """
     parts = version.split("-")
     if len(parts) != 3:
         raise ValueError("Unknown version format: %s" % version)
     return ImageNameT("%s" % parts[2])