Skip to content
Open
Show file tree
Hide file tree
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
91 changes: 91 additions & 0 deletions static/compatibilities/envoy-gateway.yaml
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to get image versions from the chart at the very least here, and i'm pretty sure the helpers also can work with oci to infer chart versions.

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: []
1 change: 1 addition & 0 deletions static/compatibilities/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
names:
- envoy-gateway
- argo-rollouts
- aws-ebs-csi-driver
- aws-efs-csi-driver
Expand Down
106 changes: 106 additions & 0 deletions utils/compatibility/scrapers/envoy-gateway.py
Original file line number Diff line number Diff line change
@@ -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")
Comment on lines +70 to +73

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unguarded index() calls for three column headers

_find_compatibility_table only verifies that "Envoy Gateway version" and "Kubernetes version" are present before returning. The three subsequent .index() calls for "Envoy Proxy version", "Rate Limit version", and "Gateway API version" are unguarded — if the Envoy Gateway site renames any of those columns the scraper raises an unhandled ValueError instead of printing a clean error and returning. Consider validating all five required headers inside _find_compatibility_table (or with an explicit check before the index lookups) and calling print_error + returning on failure.


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)