From 3e28908aa5891135c5b82b0f97627ac90aa84038 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Thu, 30 Jan 2025 09:14:01 -0500 Subject: [PATCH 1/6] Adjust workflow include to use local CI workflow --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1d42cae1..7735566c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,7 +14,7 @@ permissions: jobs: ci : - uses: rancher/backup-restore-operator/.github/workflows/ci.yaml@release/v5.0 + uses: .github/workflows/ci.yaml permissions: contents: read goreleaser: From 461f1d1593e300056b7b0b0c8ba637d0e66ea9a5 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Thu, 30 Jan 2025 10:11:06 -0500 Subject: [PATCH 2/6] WIP --- .github/workflows/ci.yaml | 2 +- scripts/ci | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b15aa6e8..b8987023 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,12 +37,12 @@ jobs: with: version: v1.62.2 build: + name : CI Build strategy: matrix: arch: - x64 - arm64 - name : build runs-on : runs-on,image=ubuntu22-full-${{ matrix.arch }},runner=4cpu-linux-${{ matrix.arch }},run-id=${{ github.run_id }} steps: - name : Checkout repository diff --git a/scripts/ci b/scripts/ci index 3ac7dc0e..ccb14ca9 100755 --- a/scripts/ci +++ b/scripts/ci @@ -3,6 +3,7 @@ set -e cd $(dirname $0) +./version ./test ./validate ./validate-ci From 6100d273f8c3ecd7b63375c5584c04050418c273 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Thu, 30 Jan 2025 11:30:00 -0500 Subject: [PATCH 3/6] Update chart/test script --- charts/rancher-backup/tests/deployment_test.yaml | 12 ++++++++++++ scripts/chart/test | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/charts/rancher-backup/tests/deployment_test.yaml b/charts/rancher-backup/tests/deployment_test.yaml index 671d415d..b2ab19b8 100644 --- a/charts/rancher-backup/tests/deployment_test.yaml +++ b/charts/rancher-backup/tests/deployment_test.yaml @@ -200,6 +200,18 @@ tests: key: "example-key" operator: "Exists" effect: "NoSchedule" +- it: should allow image tag overrides + template: deployment.yaml + set: + image: + tag: v1.2.3-abc.42 + asserts: + - matchRegex: + path: spec.template.spec.containers[0].image + pattern: v1.2.3-abc.42$ + - notMatchRegex: + path: spec.template.spec.containers[0].image + pattern: v0.0.0-nope.1$ - it: should not set default imagePullSecrets template: deployment.yaml asserts: diff --git a/scripts/chart/test b/scripts/chart/test index ffb5b104..f06eff0a 100755 --- a/scripts/chart/test +++ b/scripts/chart/test @@ -2,6 +2,9 @@ echo "-- chart/test --" +echo "Must build charts first..." +$(dirname $0)/../package-helm + # skipping tests for s390x since helm v2 doesn't support s390x yet if [ "${ARCH}" == s390x ]; then exit 0 @@ -13,4 +16,4 @@ if [ -z "$(type -p helm)" ]; then exit 1 fi -helm unittest ../build/charts/rancher-backup +helm unittest ./build/charts/rancher-backup From 5af8f7744da2681118d615119004d453a80213d4 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Thu, 30 Jan 2025 11:37:11 -0500 Subject: [PATCH 4/6] allow hull to be called directly --- scripts/hull | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/hull b/scripts/hull index 9156593c..3a867f5b 100755 --- a/scripts/hull +++ b/scripts/hull @@ -3,6 +3,10 @@ set -e function extract_version() { artifact_dir="$(dirname $0)/../dist/artifacts" + if [ ! -d "$artifact_dir" ]; then + $(dirname $0)/package-helm + fi + crdfilename=$( ls $artifact_dir | grep rancher-backup-crd ) regex="backup-crd-(.*)\\.tgz" if [[ $crdfilename =~ $regex ]] From 8bd49d4de5461a01fcbdd2cd8ed7492ce8770b86 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Thu, 30 Jan 2025 11:37:21 -0500 Subject: [PATCH 5/6] add clean-repo script --- scripts/clean-repo | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/clean-repo diff --git a/scripts/clean-repo b/scripts/clean-repo new file mode 100755 index 00000000..eed5f33b --- /dev/null +++ b/scripts/clean-repo @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Cleaning BRO repo artifacts" + +if [[ -d ./build ]]; then + echo "Cleaning old build artifacts..." + rm -rf ./build +fi + +if [[ -d ./dist ]]; then + echo "Cleaning dist artifacts..." + rm -rf ./dist +fi \ No newline at end of file From abf6f334ec9b935bf44ad9acf5ac02770f653b7c Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Thu, 30 Jan 2025 11:48:53 -0500 Subject: [PATCH 6/6] update chart path --- scripts/chart/test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/chart/test b/scripts/chart/test index f06eff0a..866aa133 100755 --- a/scripts/chart/test +++ b/scripts/chart/test @@ -16,4 +16,5 @@ if [ -z "$(type -p helm)" ]; then exit 1 fi -helm unittest ./build/charts/rancher-backup +CHART_PATH=$(realpath $(dirname $0)/../../build/charts/rancher-backup) +helm unittest $CHART_PATH