github.com/verrazzano/verrazzano@v1.7.1/tests/e2e/config/scripts/looping-test/get_resources.sh (about) 1 #!/bin/bash 2 3 # Copyright (c) 2020, 2022, Oracle and/or its affiliates. 4 # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 5 6 SCRIPT_DIR=$(cd $(dirname "$0"); pwd -P) 7 8 TYPES=`cat $SCRIPT_DIR/types.txt` 9 INCLUDE_CRDS=true 10 11 if [ -z "$1" ] ; then 12 echo "Please provide a namespace." 13 exit 1 14 fi 15 16 if [ -n "$2" ] ; then 17 INCLUDE_CRDS=$2 18 fi 19 20 namespace=$1 21 for type in ${TYPES} ; do 22 if [ "$type" == "CustomResourceDefinition" ] || [ "$type" == "APIService" ] || [ "$type" == "ValidatingWebhookConfiguration" ]; then 23 if [ "${INCLUDE_CRDS}" != true ]; then 24 continue 25 fi 26 fi 27 28 echo "kubectl get ${type} --show-kind -o custom-columns=NAME:.metadata.name,KIND:.kind --ignore-not-found --no-headers -n ${namespace}" 29 kubectl get "${type}" --show-kind -o custom-columns=NAME:.metadata.name,KIND:.kind --ignore-not-found --no-headers -n ${namespace} 30 echo 31 done