Skip to content

Instantly share code, notes, and snippets.

@swade1987
Created March 25, 2020 11:21
Show Gist options
  • Save swade1987/eb818d3d497e4f5b589595914e3d7ef9 to your computer and use it in GitHub Desktop.
Save swade1987/eb818d3d497e4f5b589595914e3d7ef9 to your computer and use it in GitHub Desktop.
policy check example
#! /usr/bin/env bash
set -euo pipefail
mkdir -p /tmp/kustomize
for env in kustomize/*; do
if [ $env == 'kustomize/base' -o $env == 'kustomize/chart-version-prefixes.txt' ]; then continue ; fi
printf "\nChecking %s\n" "${env#*/}"
kustomize build ${env} > /tmp/${env}.yaml
conftest test -p /policies/ /tmp/${env}.yaml
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment