Skip to content

Commit

Permalink
Fix hack/remove-sbr-finalizers.sh for new api (redhat-developer#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacik authored Oct 6, 2020
1 parent 7bba8d4 commit f179d71
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hack/remove-sbr-finalizers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ else
fi

# Remove SBR finalizers if CRD exists
[ -z "$(kubectl get -f deploy/crds/*crd.yaml -o jsonpath="{.metadata.name}" --ignore-not-found)" ] && exit 0
CRD_NAME=$(kubectl get -f deploy/crds/*crd.yaml -o jsonpath="{.metadata.name}" --ignore-not-found)
[ -z $CRD_NAME ] && exit 0

SBRS=($(kubectl get sbrs $USE_NS -o jsonpath="{.items[*].metadata.name}"))
SBR_NS=($(kubectl get sbrs $USE_NS -o jsonpath="{.items[*].metadata.namespace}"))
SBRS=($(kubectl get $CRD_NAME $USE_NS -o jsonpath="{.items[*].metadata.name}"))
SBR_NS=($(kubectl get $CRD_NAME $USE_NS -o jsonpath="{.items[*].metadata.namespace}"))

for i in "${!SBRS[@]}"; do
kubectl patch sbr/${SBRS[$i]} -p '{"metadata":{"finalizers":[]}}' --type=merge --namespace=${SBR_NS[$i]};
kubectl patch $CRD_NAME/${SBRS[$i]} -p '{"metadata":{"finalizers":[]}}' --type=merge --namespace=${SBR_NS[$i]};
done

0 comments on commit f179d71

Please sign in to comment.