Check if the given component is within the accepted version range. component: name of the component to verify. e.a. kustomize, etc. version: version string to verify. If the version is out of range, an error is raised program terminates.
(component, version)
| 27 | |
| 28 | |
| 29 | def check_component_version(component, version): |
| 30 | """ |
| 31 | Check if the given component is within the accepted version range. |
| 32 | component: name of the component to verify. e.a. kustomize, etc. |
| 33 | version: version string to verify. If the version is out of range, an error is raised program terminates. |
| 34 | """ |
| 35 | version = __parse_version(version) |
| 36 | version_max = __parse_version(REQ_VERSIONS[component]['MAX']) |
| 37 | version_min = __parse_version(REQ_VERSIONS[component]['MIN']) |
| 38 | if not version_min <= version <= version_max: |
| 39 | error(f'Unsupported {component} version found: "{version}".') |
| 40 | message(f'Need {component} versions between {version_min} and {version_max}.') |
| 41 | sys.exit(1) |
| 42 | |
| 43 | |
| 44 | def check_base_toolset(): |
no test coverage detected