UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 97f1ac09 authored by Bulat Khamitov's avatar Bulat Khamitov
Browse files

Merge branch '137-bb-validate-sh-clutters-files' into 'main'

Resolve "bb-validate.sh Clutters Files"

Closes #137

See merge request !189
parents 501b1478 4f70452c
No related branches found
No related tags found
1 merge request!189Resolve "bb-validate.sh Clutters Files"
Pipeline #3677634 passed with warnings
......@@ -29,6 +29,9 @@ help() {
echo "Example: Lint a specific chart against a specific policy:"
echo " ./bb_validate.sh -p require-image-signature -c elasticsearch"
echo ""
echo "Is all testing complete? Remove all the packages from your repository by running:"
echo " rm -rf ./docs/tools/repos"
echo ""
}
#image pull secret is required in each namespace to pull IB images
......@@ -84,7 +87,7 @@ get_policies() {
#install kyverno-policies, enabling only the desired policy for testing
enable_policy () {
#check that the provided policy is valid
if [[ $(echo ${POLICIES[@]} | tr -d '"'| egrep -o $1) == "" ]]; then echo "Error: Policy $1 not found. Please check that the policy name is valid any try again."; exit 1; fi
if [[ $(echo ${POLICIES[@]} | tr -d '"'| egrep -o $1) == "" ]]; then echo "Error: Policy $1 not found. Please check that the policy name is valid and try again."; exit 1; fi
echo "[*] Enabling policy $1..."
#render kyverno-policies chart where just the desired policy is enabled
helm template ./repos/kyverno-policies/chart -f ./$DISABLED_VALUES --set policies.$1.enabled=true --set policies.$1.validationFailureAction=Enforce| kubectl apply -f - >/dev/null 2>&1
......@@ -118,6 +121,11 @@ while getopts "hc:p:" flag; do
esac
done
cleanup () {
echo "[*] Running cleanup of package $1..."
rm -rf ./docs/tools/repos
}
download_artifact
install_kyverno
get_policies
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment