#!/bin/bash -eux

for NS in `kubectl get ns --no-headers -o custom-columns=":metadata.name" -l libre.sh/scope=user`; do
  kubctl -n ${NS} delete networkpolicies allow-from-ingress-namespace
  cat "/root/domains/common/networkpolicies.yml" | envsubst '$NS' | kubectl -n ${NS} diff -f -
done
