mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Merge pull request #37638 from roberthbailey/shell-equals
Automatic merge from submit-queue Fix the equality checks for numeric values in cluster/gce/util.sh. **What this PR does / why we need it**: This PR fixes an error in the gce shell scripts that results in inconsistent/incorrect behavior. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #37385 **Special notes for your reviewer**: This needs to be backported to 1.5 and 1.4. @jszczepkowski
This commit is contained in:
commit
d2badd6857
@ -1383,7 +1383,7 @@ function kube-down() {
|
|||||||
--format "value(zone)" | wc -l)
|
--format "value(zone)" | wc -l)
|
||||||
|
|
||||||
# In the replicated scenario, if there's only a single master left, we should also delete load balancer in front of it.
|
# In the replicated scenario, if there's only a single master left, we should also delete load balancer in front of it.
|
||||||
if [[ "${REMAINING_MASTER_COUNT}" == "1" ]]; then
|
if [[ "${REMAINING_MASTER_COUNT}" -eq 1 ]]; then
|
||||||
if gcloud compute forwarding-rules describe "${MASTER_NAME}" --region "${REGION}" --project "${PROJECT}" &>/dev/null; then
|
if gcloud compute forwarding-rules describe "${MASTER_NAME}" --region "${REGION}" --project "${PROJECT}" &>/dev/null; then
|
||||||
detect-master
|
detect-master
|
||||||
local REMAINING_REPLICA_NAME="$(get-all-replica-names)"
|
local REMAINING_REPLICA_NAME="$(get-all-replica-names)"
|
||||||
@ -1404,7 +1404,7 @@ function kube-down() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If there are no more remaining master replicas, we should delete all remaining network resources.
|
# If there are no more remaining master replicas, we should delete all remaining network resources.
|
||||||
if [[ "${REMAINING_MASTER_COUNT}" == "0" ]]; then
|
if [[ "${REMAINING_MASTER_COUNT}" -eq 0 ]]; then
|
||||||
# Delete firewall rule for the master, etcd servers, and nodes.
|
# Delete firewall rule for the master, etcd servers, and nodes.
|
||||||
delete-firewall-rules "${MASTER_NAME}-https" "${MASTER_NAME}-etcd" "${NODE_TAG}-all"
|
delete-firewall-rules "${MASTER_NAME}-https" "${MASTER_NAME}-etcd" "${NODE_TAG}-all"
|
||||||
# Delete the master's reserved IP
|
# Delete the master's reserved IP
|
||||||
@ -1438,7 +1438,7 @@ function kube-down() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If there are no more remaining master replicas: delete routes, pd for influxdb and update kubeconfig
|
# If there are no more remaining master replicas: delete routes, pd for influxdb and update kubeconfig
|
||||||
if [[ "${REMAINING_MASTER_COUNT}" == "0" ]]; then
|
if [[ "${REMAINING_MASTER_COUNT}" -eq 0 ]]; then
|
||||||
# Delete routes.
|
# Delete routes.
|
||||||
local -a routes
|
local -a routes
|
||||||
# Clean up all routes w/ names like "<cluster-name>-<node-GUID>"
|
# Clean up all routes w/ names like "<cluster-name>-<node-GUID>"
|
||||||
@ -1491,9 +1491,9 @@ function kube-down() {
|
|||||||
# - 1: fatal error - cluster won't be working correctly
|
# - 1: fatal error - cluster won't be working correctly
|
||||||
# - 2: weak error - something went wrong, but cluster probably will be working correctly
|
# - 2: weak error - something went wrong, but cluster probably will be working correctly
|
||||||
# We just print an error message in case 2).
|
# We just print an error message in case 2).
|
||||||
if [[ "${validate_result}" == "1" ]]; then
|
if [[ "${validate_result}" -eq 1 ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ "${validate_result}" == "2" ]]; then
|
elif [[ "${validate_result}" -eq 2 ]]; then
|
||||||
echo "...ignoring non-fatal errors in validate-cluster" >&2
|
echo "...ignoring non-fatal errors in validate-cluster" >&2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user