Skip to content

Commit

Permalink
Merge branch 'main' into KU-269/sonobuoy-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
maci3jka committed Nov 8, 2024
2 parents b71f703 + 92828c5 commit c9f3371
Show file tree
Hide file tree
Showing 72 changed files with 1,044 additions and 244 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/integration-informing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ jobs:
TEST_FLAVOR: ${{ matrix.patch }}
TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports
run: |
# IPv6-only is only supported on moonray
if [[ "${{ matrix.patch }}" == "moonray" ]]; then
export TEST_IPV6_ONLY="true"
fi
cd tests/integration && sg lxd -c 'tox -e integration'
- name: Prepare inspection reports
if: failure()
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ jobs:
TEST_SUBSTRATE: lxd
TEST_LXD_IMAGE: ${{ matrix.os }}
TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports
# Test the latest (up to) 6 releases for the flavour
# TODO(ben): upgrade nightly to run all flavours
TEST_VERSION_UPGRADE_CHANNELS: "recent 6 classic"
# Upgrading from 1.30 is not supported.
TEST_VERSION_UPGRADE_MIN_RELEASE: "1.31"
run: |
cd tests/integration && sg lxd -c 'tox -e integration'
- name: Prepare inspection reports
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
# Test the latest (up to) 6 releases for the flavour
# TODO(ben): upgrade nightly to run all flavours
TEST_VERSION_UPGRADE_CHANNELS: "recent 6 classic"
# Upgrading from 1.30 is not supported.
TEST_VERSION_UPGRADE_MIN_RELEASE: "1.31"
TEST_STRICT_INTERFACE_CHANNELS: "recent 6 strict"
run: |
export PATH="/home/runner/.local/bin:$PATH"
Expand Down
7 changes: 4 additions & 3 deletions build-scripts/hack/generate-sbom.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ def rock_coredns(manifest, extra_files):

with util.git_repo(COREDNS_ROCK_REPO, COREDNS_ROCK_TAG) as d:
rock_repo_commit = util.parse_output(["git", "rev-parse", "HEAD"], cwd=d)
rockcraft = (d / "rockcraft.yaml").read_text()
# TODO(ben): This should not be hard coded.
rockcraft = (d / "1.11.1/rockcraft.yaml").read_text()

extra_files["coredns/rockcraft.yaml"] = rockcraft
extra_files["coredns/1.11.1/rockcraft.yaml"] = rockcraft

rockcraft_yaml = yaml.safe_load(rockcraft)
repo_url = rockcraft_yaml["parts"]["coredns"]["source"]
Expand All @@ -211,7 +212,7 @@ def rock_coredns(manifest, extra_files):
"revision": rock_repo_commit,
},
"language": "go",
"details": ["coredns/rockcraft.yaml", "coredns/go.mod", "coredns/go.sum"],
"details": ["coredns/1.11.1/rockcraft.yaml", "coredns/go.mod", "coredns/go.sum"],
"source": {
"type": "git",
"repo": repo_url,
Expand Down
25 changes: 25 additions & 0 deletions build-scripts/hack/update-component-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
import sys
import yaml
from pathlib import Path
import re
import util
import urllib.request


logging.basicConfig(level=logging.INFO)

LOG = logging.getLogger(__name__)

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

Expand Down Expand Up @@ -125,6 +129,8 @@ def update_component_versions(dry_run: bool):
if not dry_run:
Path(path).write_text(version.strip() + "\n")

update_go_version(dry_run)

for component, pull_helm_chart in [
("bitnami/contour", pull_contour_chart),
("metallb", pull_metallb_chart),
Expand All @@ -134,6 +140,25 @@ def update_component_versions(dry_run: bool):
pull_helm_chart()


def update_go_version(dry_run: bool):
k8s_version = (COMPONENTS / "kubernetes/version").read_text().strip()
url = f"https://raw.githubusercontent.com/kubernetes/kubernetes/refs/tags/{k8s_version}/.go-version"
with urllib.request.urlopen(url) as response:
go_version = response.read().decode("utf-8").strip()

LOG.info("Upstream go version is %s", go_version)
go_snap = f'go/{".".join(go_version.split(".")[:2])}/stable'
snapcraft_yaml = SNAPCRAFT.read_text()
if f"- {go_snap}" in snapcraft_yaml:
LOG.info("snapcraft.yaml already contains go version %s", go_snap)
return

LOG.info("Update go snap version to %s in %s", go_snap, SNAPCRAFT)
if not dry_run:
updated = re.sub(r"- go/\d+\.\d+/stable", f"- {go_snap}", snapcraft_yaml)
SNAPCRAFT.write_text(updated)


def main():
parser = argparse.ArgumentParser(
"update-component-versions.py", usage=USAGE, description=DESCRIPTION
Expand Down
1 change: 0 additions & 1 deletion docs/canonicalk8s/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*env*/
.sphinx/venv/
.sphinx/requirements.txt
.sphinx/warnings.txt
.sphinx/.wordlist.dic
.sphinx/.doctrees/
Expand Down
11 changes: 7 additions & 4 deletions docs/canonicalk8s/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,26 @@ build:
# If there are no changes (git diff exits with 0) we force the command to return with 183.
# This is a special exit code on Read the Docs that will cancel the build immediately.
- |
git fetch --unshallow || true
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml;
then
exit 183;
fi
ls
# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: dirhtml
configuration: docs/canonicalk8s/conf.py
configuration: docs/canonicalk8s/conf-rtd.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/canonicalk8s/.sphinx/requirements.txt



22 changes: 22 additions & 0 deletions docs/canonicalk8s/.sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DO NOT MODIFY THIS FILE DIRECTLY!
#
# This file is generated automatically.
# Add custom requirements to the custom_required_modules
# array in the custom_conf.py file and run:
# make clean && make install
GitPython
canonical-sphinx-extensions
furo
linkify-it-py
myst-parser
pyspelling
sphinx
sphinx-autobuild
sphinx-copybutton
sphinx-design
sphinx-notfound-page
sphinx-tabs
sphinxcontrib-jquery
sphinxcontrib-svg2pdfconverter[CairoSVG]
sphinxext-opengraph
watchfiles
2 changes: 1 addition & 1 deletion docs/canonicalk8s/Makefile.sp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
SPHINXDIR = .sphinx
SPHINXOPTS ?= -c . -d $(SPHINXDIR)/.doctrees -j auto
SPHINXBUILD ?= sphinx-build
SOURCEDIR = src
SOURCEDIR = .
METRICSDIR = ./metrics
BUILDDIR = ../_build
VENVDIR = $(SPHINXDIR)/venv
Expand Down
Loading

0 comments on commit c9f3371

Please sign in to comment.