mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
Do not look at VPC-related resources outside the cluster's network
This commit is contained in:
parent
cfa295f569
commit
beb329f4bf
@ -29,7 +29,7 @@ set -o pipefail
|
|||||||
ZONE=${ZONE:-}
|
ZONE=${ZONE:-}
|
||||||
REGION=${ZONE%-*}
|
REGION=${ZONE%-*}
|
||||||
INSTANCE_PREFIX=${KUBE_GCE_INSTANCE_PREFIX:-${CLUSTER_NAME:-}}
|
INSTANCE_PREFIX=${KUBE_GCE_INSTANCE_PREFIX:-${CLUSTER_NAME:-}}
|
||||||
NETWORK=${KUBE_GCE_NETWORK:-${KUBE_GKE_NETWORK:-}}
|
NETWORK=${KUBE_GCE_NETWORK:-${KUBE_GKE_NETWORK:-default}}
|
||||||
|
|
||||||
# In GKE the instance prefix starts with "gke-".
|
# In GKE the instance prefix starts with "gke-".
|
||||||
if [[ "${KUBERNETES_PROVIDER:-}" == "gke" ]]; then
|
if [[ "${KUBERNETES_PROVIDER:-}" == "gke" ]]; then
|
||||||
@ -90,7 +90,7 @@ gcloud-list compute disks "${ZONE:+"zone:(${ZONE}) AND "}name ~ '${INSTANCE_PREF
|
|||||||
gcloud-list compute addresses "${REGION:+"region=(${REGION}) AND "}name ~ 'a.*|${INSTANCE_PREFIX}.*'"
|
gcloud-list compute addresses "${REGION:+"region=(${REGION}) AND "}name ~ 'a.*|${INSTANCE_PREFIX}.*'"
|
||||||
# Match either the header or a line with the specified e2e network.
|
# Match either the header or a line with the specified e2e network.
|
||||||
# This assumes that the network name is the second field in the output.
|
# This assumes that the network name is the second field in the output.
|
||||||
GREP_REGEX="^NAME\|^[^ ]\+[ ]\+\(default\|${NETWORK}\) "
|
GREP_REGEX="^NAME\|^[^ ]\+[ ]\+\(${NETWORK}\) "
|
||||||
gcloud-list compute routes "name ~ 'default.*|${INSTANCE_PREFIX}.*'"
|
gcloud-list compute routes "name ~ 'default.*|${INSTANCE_PREFIX}.*'"
|
||||||
gcloud-list compute firewall-rules "name ~ 'default.*|k8s-fw.*|${INSTANCE_PREFIX}.*'"
|
gcloud-list compute firewall-rules "name ~ 'default.*|k8s-fw.*|${INSTANCE_PREFIX}.*'"
|
||||||
GREP_REGEX=""
|
GREP_REGEX=""
|
||||||
|
Loading…
Reference in New Issue
Block a user