Don't retry creating route if it already exists

pull/6/head
gmarek 2016-12-13 15:38:57 +01:00
parent af23f40f82
commit 98fdcf155d
1 changed files with 6 additions and 1 deletions

View File

@ -2400,7 +2400,12 @@ func (gce *GCECloud) CreateRoute(clusterName string, nameHint string, route *clo
Description: k8sNodeRouteTag,
}).Do()
if err != nil {
return err
if isHTTPErrorCode(err, http.StatusConflict) {
glog.Info("Route %v already exists.")
return nil
} else {
return err
}
}
return gce.waitForGlobalOp(insertOp)
}