def _strip_tag_version(tag, semver_versions):
    """
    Strip the version from the front of the given tag (not image tag) if the
    version is present.

    :param semver_versions:
        A list of versions from longest to shortest.
    """
    if tag is None:
        return None
    for version in semver_versions:
        if tag == version:
            return ''
        if tag.startswith(version + '-'):
            return tag[len(version) + 1:]

    return tag