Skip to content

Commit

Permalink
Fix installer script (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Mar 28, 2018
1 parent 323f863 commit b40d1e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hack/deploy/searchlight.sh
Expand Up @@ -181,25 +181,25 @@ if [ "$SEARCHLIGHT_UNINSTALL" -eq 1 ]; then
# https://github.com/kubernetes/kubernetes/issues/60538
if [ "$SEARCHLIGHT_PURGE" -eq 1 ]; then
for crd in "${crds[@]}"; do
pairs=($(kubectl get ${crd}.searchlight.appscode.com --all-namespaces -o jsonpath='{range .items[*]}{.metadata.name} {.metadata.namespace} {end}' || true))
pairs=($(kubectl get ${crd}.monitoring.appscode.com --all-namespaces -o jsonpath='{range .items[*]}{.metadata.name} {.metadata.namespace} {end}' || true))
total=${#pairs[*]}

# save objects
if [ $total -gt 0 ]; then
echo "dumping ${crd} objects into ${crd}.yaml"
kubectl get ${crd}.searchlight.appscode.com --all-namespaces -o yaml > ${crd}.yaml
kubectl get ${crd}.monitoring.appscode.com --all-namespaces -o yaml > ${crd}.yaml
fi

for (( i=0; i<$total; i+=2 )); do
name=${pairs[$i]}
namespace=${pairs[$i + 1]}
# delete crd object
echo "deleting ${crd} $namespace/$name"
kubectl delete ${crd}.searchlight.appscode.com $name -n $namespace
kubectl delete ${crd}.monitoring.appscode.com $name -n $namespace
done

# delete crd
kubectl delete crd ${crd}.searchlight.appscode.com || true
kubectl delete crd ${crd}.monitoring.appscode.com || true
done
fi

Expand Down Expand Up @@ -254,7 +254,7 @@ done

echo "waiting until searchlight crds are ready"
for crd in "${crds[@]}"; do
$ONESSL wait-until-ready crd ${crd}.searchlight.appscode.com || { echo "$crd crd failed to be ready"; exit 1; }
$ONESSL wait-until-ready crd ${crd}.monitoring.appscode.com || { echo "$crd crd failed to be ready"; exit 1; }
done

echo
Expand Down

0 comments on commit b40d1e9

Please sign in to comment.