diff --git a/static/compatibilities/envoy-gateway.yaml b/static/compatibilities/envoy-gateway.yaml new file mode 100644 index 0000000000..7767176a40 --- /dev/null +++ b/static/compatibilities/envoy-gateway.yaml @@ -0,0 +1,91 @@ +icon: https://raw.githubusercontent.com/envoyproxy/gateway/main/site/static/icons/logo.svg +git_url: https://github.com/envoyproxy/gateway +release_url: https://github.com/envoyproxy/gateway/releases/tag/v{vsn} +readme_url: https://gateway.envoyproxy.io/news/releases/matrix/ +helm_repository_url: oci://docker.io/envoyproxy/gateway-helm +chart_name: gateway-helm +versions: +- version: 1.8.0 + kube: ['1.35', '1.34', '1.33', '1.32'] + requirements: [] + chart_version: 1.8.0 + images: ['docker.io/envoyproxy/gateway:v1.8.0'] + incompatibilities: [] +- version: 1.7.0 + kube: ['1.35', '1.34', '1.33', '1.32'] + requirements: [] + chart_version: 1.7.0 + images: ['docker.io/envoyproxy/gateway:v1.7.0'] + incompatibilities: [] +- version: 1.6.0 + kube: ['1.33', '1.32', '1.31', '1.30'] + requirements: [] + chart_version: 1.6.0 + images: ['docker.io/envoyproxy/gateway:v1.6.0'] + incompatibilities: [] +- version: 1.5.0 + kube: ['1.33', '1.32', '1.31', '1.30'] + requirements: [] + chart_version: 1.5.0 + images: ['docker.io/envoyproxy/gateway:v1.5.0'] + incompatibilities: [] +- version: 1.4.0 + kube: ['1.33', '1.32', '1.31', '1.30'] + requirements: [] + chart_version: 1.4.0 + images: ['docker.io/envoyproxy/gateway:v1.4.0'] + incompatibilities: [] +- version: 1.3.0 + kube: ['1.32', '1.31', '1.30', '1.29'] + requirements: [] + chart_version: 1.3.0 + images: ['docker.io/envoyproxy/gateway:v1.3.0'] + incompatibilities: [] +- version: 1.2.0 + kube: ['1.31', '1.30', '1.29', '1.28'] + requirements: [] + chart_version: 1.2.0 + images: ['docker.io/envoyproxy/gateway:v1.2.0'] + incompatibilities: [] +- version: 1.1.0 + kube: ['1.30', '1.29', '1.28', '1.27'] + requirements: [] + chart_version: 1.1.0 + images: ['docker.io/envoyproxy/gateway:v1.1.0'] + incompatibilities: [] +- version: 1.0.0 + kube: ['1.29', '1.28', '1.27', '1.26'] + requirements: [] + chart_version: 1.0.0 + images: ['docker.io/envoyproxy/gateway:v1.0.0'] + incompatibilities: [] +- version: 0.6.0 + kube: ['1.28', '1.27', '1.26'] + requirements: [] + chart_version: 0.6.0 + images: ['docker.io/envoyproxy/gateway:v0.6.0'] + incompatibilities: [] +- version: 0.5.0 + kube: ['1.27', '1.26', '1.25'] + requirements: [] + chart_version: 0.5.0 + images: ['docker.io/envoyproxy/gateway:v0.5.0'] + incompatibilities: [] +- version: 0.4.0 + kube: ['1.27', '1.26', '1.25'] + requirements: [] + chart_version: 0.4.0 + images: ['docker.io/envoyproxy/gateway:v0.4.0'] + incompatibilities: [] +- version: 0.3.0 + kube: ['1.26', '1.25', '1.24'] + requirements: [] + chart_version: 0.3.0 + images: ['docker.io/envoyproxy/gateway:v0.3.0'] + incompatibilities: [] +- version: 0.2.0 + kube: ['1.24'] + requirements: [] + chart_version: 0.2.0 + images: ['docker.io/envoyproxy/gateway:v0.2.0'] + incompatibilities: [] diff --git a/static/compatibilities/manifest.yaml b/static/compatibilities/manifest.yaml index 2be754b662..24543a7337 100644 --- a/static/compatibilities/manifest.yaml +++ b/static/compatibilities/manifest.yaml @@ -1,4 +1,5 @@ names: +- envoy-gateway - argo-rollouts - aws-ebs-csi-driver - aws-efs-csi-driver diff --git a/utils/compatibility/scrapers/envoy-gateway.py b/utils/compatibility/scrapers/envoy-gateway.py new file mode 100644 index 0000000000..f0ae79f90c --- /dev/null +++ b/utils/compatibility/scrapers/envoy-gateway.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections import OrderedDict + +from bs4 import BeautifulSoup + +from utils import fetch_page, get_chart_images, print_error, update_compatibility_info + + +APP_NAME = "envoy-gateway" +COMPATIBILITY_URL = "https://gateway.envoyproxy.io/news/releases/matrix/" +TARGET_FILE = f"../../static/compatibilities/{APP_NAME}.yaml" +CHART_URL = "oci://docker.io/envoyproxy/gateway-helm" +CHART_NAME = "gateway-helm" + + +def _decode(content): + return content.decode("utf-8", errors="replace") if isinstance(content, bytes) else content + + +def _clean_version(value: str) -> str: + version = value.strip().lstrip("v") + if version == "latest": + return version + if version and version.count(".") == 1: + return f"{version}.0" + return version + + +def _clean_kube_version(value: str) -> str: + return value.strip().lstrip("v") + + +def _parse_kube_versions(value: str) -> list[str]: + versions = [] + for raw_version in value.split(","): + version = _clean_kube_version(raw_version) + if version: + versions.append(version) + return versions + + +def _find_compatibility_table(soup: BeautifulSoup): + required_headers = [ + "Envoy Gateway version", + "Kubernetes version", + ] + + for table in soup.find_all("table"): + headers = [th.get_text(" ", strip=True) for th in table.find_all("th")] + if all(header in headers for header in required_headers): + return table, headers + return None, [] + + +def _chart_images(chart_version: str) -> list[str]: + return get_chart_images(CHART_URL, CHART_NAME, chart_version) or [] + + +def scrape(): + content = fetch_page(COMPATIBILITY_URL) + if not content: + print_error("Failed to fetch Envoy Gateway compatibility matrix.") + return + + soup = BeautifulSoup(_decode(content), "html.parser") + table, headers = _find_compatibility_table(soup) + if not table: + print_error("Envoy Gateway compatibility table not found.") + return + + gateway_idx = headers.index("Envoy Gateway version") + kube_idx = headers.index("Kubernetes version") + + versions = [] + for row in table.find_all("tr")[1:]: + cells = [td.get_text(" ", strip=True) for td in row.find_all("td")] + if len(cells) <= max(gateway_idx, kube_idx): + continue + + version = _clean_version(cells[gateway_idx]) + if not version or version == "latest": + continue + + kube_versions = _parse_kube_versions(cells[kube_idx]) + if not kube_versions: + continue + + versions.append( + OrderedDict( + [ + ("version", version), + ("kube", kube_versions), + ("requirements", []), + ("chart_version", version), + ("images", _chart_images(version)), + ("incompatibilities", []), + ] + ) + ) + + if not versions: + print_error("No Envoy Gateway compatibility rows parsed.") + return + + update_compatibility_info(TARGET_FILE, versions)