Skip to content

Commit

Permalink
audit: allow specific project audits
Browse files Browse the repository at this point in the history
For faster local dev, `audit-gcp.sh k8s-infra-foo` will delete and
re-export audit files just for the k8s-infra-foo project
  • Loading branch information
spiffxp committed May 25, 2021
1 parent 2d8ca9b commit b4641d8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion audit/audit-gcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function audit_gcp_project_service() {
esac
}

function main() {
function audit_k8s_infra_gcp() {
echo "Removing all existing GCP project audit files"
remove_all_gcp_project_audit_files 2>&1 | indent

Expand All @@ -302,4 +302,15 @@ function main() {
audit_all_projects_with_parent_id "${KUBERNETES_IO_GCP_ORG}" 2>&1 | indent
}

function main() {
if [ $# -gt 0 ]; then
for project in "$@"; do
echo "Exporting GCP project: ${project}"
audit_gcp_project "${project}" 2>&1 | indent
done
else
audit_k8s_infra_gcp
fi
}

main "$@"

0 comments on commit b4641d8

Please sign in to comment.