From e02483e3feaaede55c99d49931710475d0d2f79c Mon Sep 17 00:00:00 2001 From: Jeff Lowdermilk Date: Tue, 2 Jun 2015 10:54:35 -0700 Subject: [PATCH] Fix route regexp for gce-kube-down --- cluster/gce/util.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 5ebe3546151..c9685406363 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -816,10 +816,14 @@ function kube-down { # Delete routes. local -a routes - # Clean up all routes w/ names like "-minion-<4-char-node-identifier>" - # e.g. "kubernetes-minion-2pl1" + # Clean up all routes w/ names like "-" + # e.g. "kubernetes-12345678-90ab-cdef-1234-567890abcdef". The name is + # determined by the node controller on the master. + # Note that this is currently a noop, as synchronously deleting the node MIG + # first allows the master to cleanup routes itself. + local TRUNCATED_PREFIX="${INSTANCE_PREFIX:0:26}" routes=( $(gcloud compute routes list --project "${PROJECT}" \ - --regexp "${INSTANCE_PREFIX}-minion-.{4}" | awk 'NR >= 2 { print $1 }') ) + --regexp "${TRUNCATED_PREFIX}-.{8}-.{4}-.{4}-.{4}-.{12}" | awk 'NR >= 2 { print $1 }') ) while (( "${#routes[@]}" > 0 )); do echo Deleting routes "${routes[*]::10}" gcloud compute routes delete \