-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from kravciak/2025
Helm chart testing
- Loading branch information
Showing
9 changed files
with
77 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
CRD=$2 | ||
export CRD=$2 | ||
SOURCEDIR="$1" | ||
TARGETDIR="$1/resources_${CRD#*/}" | ||
|
||
# Copy files to versioned directory | ||
mkdir -p $TARGETDIR | ||
cp -a $SOURCEDIR/*.yaml $TARGETDIR | ||
|
||
# Replace policies apiVersion with $CRD | ||
grep -rlZ "apiVersion: policies.kubewarden.io" $TARGETDIR | xargs -0 \ | ||
yq -i -Y --arg c $CRD '.apiVersion = $c' | ||
# There are 2 implementations of yq, from mikefarah and kislyuk | ||
# yq_kislyuk=(yq -i -Y '.apiVersion = env.CRD') | ||
# yq_mikefarah=(yq eval -i '.apiVersion = env(CRD)') | ||
|
||
# Github runners default to mikefarah, let's support both for local runs | ||
# yq --version | grep -q mikefarah && yqcmd=("${yq_mikefarah[@]}") || yqcmd=("${yq_kislyuk[@]}") | ||
|
||
# Replace apiVersion: policies.kubewarden.io/* -> policies.kubewarden.io/v1 | ||
# grep -rlZ "apiVersion: policies.kubewarden.io" "$TARGETDIR" | xargs -0 -I {} "${yqcmd[@]}" {} | ||
|
||
grep -rlZ "apiVersion: policies.kubewarden.io" "$TARGETDIR" | xargs -0 -I {} yq -i '.apiVersion = env(CRD)' {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters