#!/bin/bash -eux

kubectl get psmdb -A
for ns in `kubectl get psmdb -A | grep -v cluster | grep chat | cut -d" " -f1`; do
  cd $ns/chat
  libre diff ../../common/rocketchat/manifests/mongo-operator.yml || true
  libre apply ../../common/rocketchat/manifests/mongo-operator.yml
  libre diff ../../common/rocketchat/manifests/mongo.yml || true
  libre apply ../../common/rocketchat/manifests/mongo.yml
  cd ../..
done
