diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 946e566aa..799acad06 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -5,13 +5,14 @@ on: branches: - main - autoupdate/strict + - autoupdate/moonray - 'release-[0-9]+.[0-9]+' - 'autoupdate/release-[0-9]+.[0-9]+-strict' - 'autoupdate/sync/**' pull_request: permissions: - contents: read + contents: read jobs: test: diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index e309e5e6e..2ba44214a 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -5,6 +5,7 @@ on: branches: - main - autoupdate/strict + - autoupdate/moonray - 'release-[0-9]+.[0-9]+' - 'autoupdate/release-[0-9]+.[0-9]+-strict' - 'autoupdate/sync/**' diff --git a/.github/workflows/moonray.yaml b/.github/workflows/moonray.yaml new file mode 100644 index 000000000..b96b845c6 --- /dev/null +++ b/.github/workflows/moonray.yaml @@ -0,0 +1,31 @@ +name: Auto-update moonray branch + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + update: + permissions: + contents: write # for Git to git push + runs-on: ubuntu-22.04 + steps: + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + - name: Sync ${{ github.ref }} to autoupdate/moonray + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.DEPLOY_KEY_TO_UPDATE_STRICT_BRANCH }} + - name: Apply moonray patch + run: | + git checkout -b autoupdate/moonray + ./build-scripts/patches/moonray/apply + - name: Push to autoupdate/moonray + run: | + git push origin --force autoupdate/moonray diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 65028fbbb..2ccb0979f 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -5,6 +5,7 @@ on: branches: - main - autoupdate/strict + - autoupdate/moonray - 'release-[0-9]+.[0-9]+' - 'autoupdate/release-[0-9]+.[0-9]+-strict' - 'autoupdate/sync/**' diff --git a/.github/workflows/sbom.yaml b/.github/workflows/sbom.yaml index d3f0eab88..846a19e76 100644 --- a/.github/workflows/sbom.yaml +++ b/.github/workflows/sbom.yaml @@ -5,6 +5,7 @@ on: branches: - main - autoupdate/strict + - autoupdate/moonray - 'release-[0-9]+.[0-9]+' - 'autoupdate/release-[0-9]+.[0-9]+-strict' - 'autoupdate/sync/**' diff --git a/build-scripts/patches/moonray/0001-Moonray.patch b/build-scripts/patches/moonray/0001-Moonray.patch new file mode 100644 index 000000000..7226438e9 --- /dev/null +++ b/build-scripts/patches/moonray/0001-Moonray.patch @@ -0,0 +1,24 @@ +From de526e476d051fbc5ec4cfbec383a60729434159 Mon Sep 17 00:00:00 2001 +From: Benjamin Schimke +Date: Wed, 5 Jun 2024 09:48:57 +0200 +Subject: [PATCH] Moonray + +--- + src/k8s/pkg/k8sd/features/implementation_default.go | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/k8s/pkg/k8sd/features/implementation_default.go b/src/k8s/pkg/k8sd/features/implementation_default.go +index aac2d97..313a7f5 100644 +--- a/src/k8s/pkg/k8sd/features/implementation_default.go ++++ b/src/k8s/pkg/k8sd/features/implementation_default.go +@@ -12,6 +12,7 @@ import ( + // CoreDNS is used for DNS. + // MetricsServer is used for metrics-server. + // LocalPV Rawfile CSI is used for local-storage. ++// TODO: Replace with moonray specific implementation. + var Implementation Interface = &implementation{ + applyDNS: coredns.ApplyDNS, + applyNetwork: cilium.ApplyNetwork, +-- +2.34.1 + diff --git a/build-scripts/patches/moonray/apply b/build-scripts/patches/moonray/apply new file mode 100755 index 000000000..8f965d03a --- /dev/null +++ b/build-scripts/patches/moonray/apply @@ -0,0 +1,14 @@ +#!/bin/bash -xe + +DIR="$(realpath "$(dirname "${0}")")" + +# Configure git author +git config user.email k8s-bot@canonical.com +git config user.name k8s-bot + +# Remove unrelated tests +rm "${DIR}/../../../tests/integration/tests/test_cilium_e2e.py" +git commit -a -m "Remove unrelated tests" + +# Apply strict patch +git am "${DIR}/0001-Moonray.patch"