From 2ed8949a70f549ab993fa48a48aaab37faade8f2 Mon Sep 17 00:00:00 2001 From: Felix Matouschek Date: Tue, 31 Oct 2023 13:58:13 +0100 Subject: [PATCH] fix: Replace j2cli with jinjanator in GitHub workflows j2cli is unmaintained and no longer works with python3.12. It is therefore replaced with an active fork called jinjanator. The improper use of the '-e' flag on the j2 binary is fixed. Since the env is used as data source there is also no need to import variables explicitly again. Signed-off-by: Felix Matouschek --- .github/workflows/check.yaml | 3 ++- .github/workflows/e2e-containerd.yaml | 3 ++- .github/workflows/image-push.yaml | 3 ++- hack/generate_manifests.sh | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 7efc0bd3..d0e1e780 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -15,7 +15,8 @@ jobs: python-version: 3.x - run: | - pip3 install --user --upgrade j2cli + pip3 install --user --upgrade jinjanator + ln -s ~/.local/bin/jinjanate ~/.local/bin/j2 j2 --version - uses: actions/checkout@v3 diff --git a/.github/workflows/e2e-containerd.yaml b/.github/workflows/e2e-containerd.yaml index f62a76f6..a8674907 100644 --- a/.github/workflows/e2e-containerd.yaml +++ b/.github/workflows/e2e-containerd.yaml @@ -15,7 +15,8 @@ jobs: python-version: 3.x - run: | - pip3 install --user --upgrade j2cli + pip3 install --user --upgrade jinjanator + ln -s ~/.local/bin/jinjanate ~/.local/bin/j2 j2 --version - uses: actions/checkout@v3 diff --git a/.github/workflows/image-push.yaml b/.github/workflows/image-push.yaml index 31cbac5d..5b49897d 100644 --- a/.github/workflows/image-push.yaml +++ b/.github/workflows/image-push.yaml @@ -55,7 +55,8 @@ jobs: - name: Install the j2 dependency if: startsWith(github.ref, 'refs/tags/') run: | - pip3 install --user --upgrade j2cli + pip3 install --user --upgrade jinjanator + ln -s ~/.local/bin/jinjanate ~/.local/bin/j2 j2 --version - name: Template release manifests diff --git a/hack/generate_manifests.sh b/hack/generate_manifests.sh index 3a366a1b..bc691670 100755 --- a/hack/generate_manifests.sh +++ b/hack/generate_manifests.sh @@ -8,12 +8,12 @@ templates_dir="$ROOT/templates" for file in `ls $templates_dir/`; do echo $file if [ -z $CRIO_RUNTIME ]; then - j2 -e MULTUS_SOCKET_PATH -e IMAGE_REGISTRY -e IMAGE_TAG -e CRI_SOCKET_PATH -e NAMESPACE ${templates_dir}/$file -o "manifests/${file%.j2}" + j2 ${templates_dir}/$file -o "manifests/${file%.j2}" else if [ $file != "dynamic-networks-controller.yaml.j2" ]; then continue fi - j2 -e MULTUS_SOCKET_PATH -e CRIO_RUNTIME -e IMAGE_REGISTRY -e IMAGE_TAG -e CRI_SOCKET_PATH -e NAMESPACE ${templates_dir}/$file -o "manifests/crio-${file%.j2}" + j2 ${templates_dir}/$file -o "manifests/crio-${file%.j2}" fi done unset IMAGE_REGISTRY