Last active
July 22, 2020 23:43
-
-
Save trevorbox/a5ec53af4a0d7d476ceefe6e3a4876f2 to your computer and use it in GitHub Desktop.
Kiali member and maistra member label mismatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Starting job at $(date)..." | |
OUT=$(oc get projects -o go-template=$'{{range .items}}{{with .metadata}}{{if .labels}}{{ $kiali:=("" | or (index .labels "kiali.io/member-of")) }}{{ $maistra:=("" | or (index .labels "maistra.io/member-of")) }}{{if ne $kiali $maistra}}Mismatch => project:{{.name}} kiali.io/member-of:{{$kiali}} maistra.io/member-of:{{$maistra}}\n{{end}}{{end}}{{end}}{{end}}') | |
echo "$OUT" | |
if [ -z "$OUT" ]; then echo "No mismatches found."; fi | |
echo "Done at $(date)." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment