Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installer script #323

Merged
merged 1 commit into from
Mar 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions hack/deploy/searchlight.sh
Original file line number Diff line number Diff line change
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