Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from copy import deepcopy
from knack.log import get_logger
from knack.prompting import prompt, prompt_y_n
from packaging import version as packaging_version
from semver import VersionInfo

from ..vendored_sdks.models import Extension, PatchExtension, Scope, ScopeCluster
from .DefaultExtension import DefaultExtension
Expand Down Expand Up @@ -204,7 +204,7 @@ def _is_downgrade(v1: str, v2: str) -> bool:
Returns True if version v1 is less than version v2.
"""
try:
return packaging_version.Version(v1) < packaging_version.Version(v2)
except packaging_version.InvalidVersion:
return VersionInfo.parse(v1) < VersionInfo.parse(v2)
except ValueError:
logger.debug("Warning: Unable to compare versions %s and %s.", v1, v2)
return True # This will cause the apply-CRDs hook to be disabled, which is safe.