Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eaudetcobello committed Jun 24, 2024
1 parent 8dbf304 commit 4d3dcab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 3 additions & 6 deletions build-scripts/hack/update-component-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import argparse
import logging
import sys
import yaml
from pathlib import Path
import util

Expand Down Expand Up @@ -45,6 +44,7 @@
METALLB_REPO = "https://metallb.github.io/metallb"
METALLB_CHART_VERSION = "0.14.5"


def get_kubernetes_version() -> str:
"""Update Kubernetes version based on the specified marker file"""
LOG.info("Checking latest Kubernetes version from %s", KUBERNETES_VERSION_MARKER)
Expand All @@ -67,10 +67,12 @@ 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"""
containerd_repo = util.read_file(COMPONENTS / "containerd/repository")
Expand Down Expand Up @@ -104,11 +106,6 @@ def pull_metallb_chart() -> None:
util.helm_pull("metallb", METALLB_REPO, METALLB_CHART_VERSION, CHARTS)


def pull_metrics_server_chart() -> None:
LOG.info("Pulling Metrics Server chart @ %s", METRICS_CHART_VERSION)
util.helm_pull("metrics-server", METRICS_REPO, METRICS_CHART_VERSION, CHARTS)


def update_component_versions(dry_run: bool):
for component, get_version in [
("kubernetes", get_kubernetes_version),
Expand Down
3 changes: 1 addition & 2 deletions build-scripts/hack/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import tempfile
import subprocess
import logging
import yaml
from urllib.request import urlopen
from pathlib import Path

Expand Down Expand Up @@ -50,6 +49,7 @@ def read_file(path: Path) -> str:
def read_url(url: str) -> str:
return urlopen(url).read().decode().strip()


def helm_pull(chart, repo_url: str, version: str, destination: Path) -> None:
parse_output(
[
Expand All @@ -66,4 +66,3 @@ def helm_pull(chart, repo_url: str, version: str, destination: Path) -> None:
)

LOG.info("Pulled helm chart %s @ %s as %s to %s", chart, version, repo_url, destination)

0 comments on commit 4d3dcab

Please sign in to comment.