Skip to content

Commit

Permalink
update component contour
Browse files Browse the repository at this point in the history
  • Loading branch information
louiseschmidtgen committed Jun 13, 2024
1 parent 7fddaa7 commit d4665f5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build-scripts/hack/update-component-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

DIR = Path(__file__).absolute().parent
COMPONENTS = DIR.parent / "components"
CHARTS = DIR.parent.parent / "k8s" / "manifests" / "charts"

# Version marker for latest Kubernetes version. Expected to be one of:
#
Expand All @@ -36,6 +37,9 @@
# Helm release branch to track. The most recent tag in the branch will be used.
HELM_RELEASE_BRANCH = "release-3.14"

# Contour Helm repository and chart version
CONTOUR_HELM_REPO = "https://charts.bitnami.com/bitnami"
CONTOUR_CHART_VERSION = "17.0.4"

def get_kubernetes_version() -> str:
"""Update Kubernetes version based on the specified marker file"""
Expand All @@ -59,6 +63,9 @@ def get_cni_version() -> str:

raise Exception(f"Failed to find cni dependency in {deps_file}")

def pull_contour_chart() -> None:
LOG.info("Pulling Contour Helm chart from %s with version %s", CONTOUR_HELM_REPO, CONTOUR_CHART_VERSION)
util.helm_pull("contour", CONTOUR_HELM_REPO, CONTOUR_CHART_VERSION, CHARTS)

def get_containerd_version() -> str:
"""Update containerd version using latest tag of specified branch"""
Expand Down Expand Up @@ -101,6 +108,13 @@ def update_component_versions(dry_run: bool):
if not dry_run:
Path(path).write_text(version.strip() + "\n")

for component, pull_helm_chart in [
("contour", pull_contour_chart),
]:
LOG.info("Updating chart for %s", component)
if not dry_run:
pull_helm_chart()


def main():
parser = argparse.ArgumentParser(
Expand Down
7 changes: 7 additions & 0 deletions build-scripts/hack/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import tempfile
import subprocess
import logging
import yaml
from urllib.request import urlopen
from pathlib import Path

Expand Down Expand Up @@ -48,3 +49,9 @@ def read_file(path: Path) -> str:

def read_url(url: str) -> str:
return urlopen(url).read().decode().strip()

def helm_pull(chart_name: str, repo_url: str, version: str, destination: Path) -> None:
parse_output(["helm", "repo", "add", chart_name, repo_url])
parse_output(["helm", "pull", f"{chart_name}/{chart_name}", "--version", version, "--destination", destination])

LOG.info("Pulled helm repository %s @ %s as %s to %s", repo_url, version, chart_name, destination)
6 changes: 6 additions & 0 deletions tests/integration/tests/test_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def test_ingress(session_instance: List[harness.Instance]):
capture_output=True,
)

LOG.info("Waiting for ingress class to show up...")
util.stubbornly(retries=15, delay_s=2).on(session_instance).until(
lambda p: "ck-ingress" in p.stdout.decode()
).exec(["k8s", "kubectl", "get", "ingressclass", "ck-ingress", "-o", "json"])
LOG.INFO("Ingress class showed up.")

ingress_http_port = None
services = json.loads(p.stdout.decode())
for svc in services["items"]:
Expand Down

0 comments on commit d4665f5

Please sign in to comment.