mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #44465 from bowei/fix-cluster-up
Automatic merge from submit-queue Missing --project in the cluster up scripts for gce ```release-note NONE ```
This commit is contained in:
commit
eda8e12723
@ -736,7 +736,9 @@ function create-subnetwork() {
|
|||||||
# Look for the subnet, it must exist and have a secondary range
|
# Look for the subnet, it must exist and have a secondary range
|
||||||
# configured.
|
# configured.
|
||||||
local subnet=$(gcloud alpha compute networks subnets describe \
|
local subnet=$(gcloud alpha compute networks subnets describe \
|
||||||
--region ${REGION} ${IP_ALIAS_SUBNETWORK} 2>/dev/null)
|
--project "${PROJECT}" \
|
||||||
|
--region ${REGION} \
|
||||||
|
${IP_ALIAS_SUBNETWORK} 2>/dev/null)
|
||||||
if [[ -z ${subnet} ]]; then
|
if [[ -z ${subnet} ]]; then
|
||||||
# Only allow auto-creation for default subnets
|
# Only allow auto-creation for default subnets
|
||||||
if [[ ${IP_ALIAS_SUBNETWORK} != ${INSTANCE_PREFIX}-subnet-default ]]; then
|
if [[ ${IP_ALIAS_SUBNETWORK} != ${INSTANCE_PREFIX}-subnet-default ]]; then
|
||||||
@ -753,6 +755,7 @@ function create-subnetwork() {
|
|||||||
gcloud alpha compute networks subnets create \
|
gcloud alpha compute networks subnets create \
|
||||||
${IP_ALIAS_SUBNETWORK} \
|
${IP_ALIAS_SUBNETWORK} \
|
||||||
--description "Automatically generated subnet for ${INSTANCE_PREFIX} cluster. This will be removed on cluster teardown." \
|
--description "Automatically generated subnet for ${INSTANCE_PREFIX} cluster. This will be removed on cluster teardown." \
|
||||||
|
--project "${PROJECT}" \
|
||||||
--network ${NETWORK} \
|
--network ${NETWORK} \
|
||||||
--region ${REGION} \
|
--region ${REGION} \
|
||||||
--range ${NODE_IP_RANGE} \
|
--range ${NODE_IP_RANGE} \
|
||||||
@ -800,9 +803,13 @@ function delete-subnetwork() {
|
|||||||
|
|
||||||
echo "Removing auto-created subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}"
|
echo "Removing auto-created subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}"
|
||||||
if [[ -n $(gcloud alpha compute networks subnets describe \
|
if [[ -n $(gcloud alpha compute networks subnets describe \
|
||||||
--region ${REGION} ${IP_ALIAS_SUBNETWORK} 2>/dev/null) ]]; then
|
--project "${PROJECT}" \
|
||||||
|
--region ${REGION} \
|
||||||
|
${IP_ALIAS_SUBNETWORK} 2>/dev/null) ]]; then
|
||||||
gcloud alpha --quiet compute networks subnets delete \
|
gcloud alpha --quiet compute networks subnets delete \
|
||||||
--region ${REGION} ${IP_ALIAS_SUBNETWORK}
|
--project "${PROJECT}" \
|
||||||
|
--region ${REGION} \
|
||||||
|
${IP_ALIAS_SUBNETWORK}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user