From 6565c519693863d4c41e3cc8af4ae11bb068719f Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:19:50 -0500 Subject: [PATCH] Build generator directly rather than downloading it `stolostron` doesn't have releases like upstream does. Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> --- .gitignore | 1 + build/validate-policies.sh | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 90acb4de7..f21a6c8a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ deploy/manifests.yaml .idea bin +schemas diff --git a/build/validate-policies.sh b/build/validate-policies.sh index 05cdc4307..1e965698e 100755 --- a/build/validate-policies.sh +++ b/build/validate-policies.sh @@ -80,10 +80,11 @@ GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v4@$KUSTOMIZE_VERSION export KUSTOMIZE_PLUGIN_HOME=${GOBIN} echo "Downloading the generator" PLATFORM=`uname | tr '[:upper:]' '[:lower:]'` -curl -Ls -o generator https://github.com/${GITHUB_REPOSITORY_OWNER}/policy-generator-plugin/releases/latest/download/${PLATFORM}-amd64-PolicyGenerator -chmod a+x generator +git clone --depth=1 https://github.com/${GITHUB_REPOSITORY_OWNER}/policy-generator-plugin +( cd policy-generator-plugin; make build-binary ) +chmod a+x policy-generator-plugin/PolicyGenerator mkdir -p ${KUSTOMIZE_PLUGIN_HOME}/${GENERATOR_PATH} -mv generator ${KUSTOMIZE_PLUGIN_HOME}/${GENERATOR_PATH}/PolicyGenerator +mv policy-generator-plugin/PolicyGenerator ${KUSTOMIZE_PLUGIN_HOME}/${GENERATOR_PATH}/PolicyGenerator # Validate the generator projects @@ -94,6 +95,6 @@ echo "Checking community policy sets" validatePolicySets community # Cleanup -rm -rf schemas +rm -rf schemas policy-generator-plugin # Done