github.com/verrazzano/verrazzano@v1.7.1/tests/e2e/config/scripts/looping-test/verify_uninstall.sh (about)

     1  #!/bin/bash -x
     2  
     3  # Copyright (c) 2020, 2023, 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  if [ -z "$1" ] ; then
     7    echo "Please provide the directory containing the resources"
     8    exit 1
     9  fi
    10  
    11  SCRIPT_DIR="$1"
    12  DIFF_FOUND=false
    13  
    14  # Account for capi related clusterroles/clusterroleindings that are not deleted during capi delete
    15  sed -i "/capi-.*ClusterRole.*/d" ${SCRIPT_DIR}/post-uninstall-resources/default.txt
    16  sed -i "/capoci-.*ClusterRole.*/d" ${SCRIPT_DIR}/post-uninstall-resources/default.txt
    17  sed -i "/caapv-.*ClusterRole.*/d" ${SCRIPT_DIR}/post-uninstall-resources/default.txt
    18  
    19  DIFF=$(diff ${SCRIPT_DIR}/pre-install-resources/default.txt ${SCRIPT_DIR}/post-uninstall-resources/default.txt | grep "^>")
    20  echo "Remaining resources:"
    21  echo $DIFF
    22  
    23  if [ -z "$DIFF" ] ; then
    24    echo "No resources found as expected"
    25  else
    26    DIFF_FOUND=true
    27  fi
    28  
    29  if [ "$DIFF_FOUND" == true ] ; then
    30    exit 1
    31  fi