#!/usr/bin/env bash # Purpose: Prints a nice table mapping banner guids to their gcp project ids and display names set -eu context=$(kubectl config current-context) if [[ "$context" != *"banner-infra"* ]]; then echo "current k8s context is $context. expected a banner-infra cluster" exit 1 fi colsarr=( 'DISPLAY NAME:spec.displayName' 'GCP ID:spec.gcp.projectId' 'GUID (NAMESPACE):metadata.name' ) cols=$(printf ",%s" "${colsarr[@]}") kubectl get banners \ --sort-by='{.spec.displayName}' \ -o custom-columns="${cols:1}" \ 2> /dev/null # blackhole annoying throttle warnings