Unverified Commit f79ab9c1 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #62193 from shyamjvs/ip-alias-fix

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix IP-alias subnet creation logic Follows https://github.com/kubernetes/kubernetes/pull/62172 This fixes the failures happening when using ip-alias with custom network. The subnet name shouldn't be checked against the default value during creation, but just created if not present (as it's name can be different than default based on the value of `KUBE_GCE_IP_ALIAS_SUBNETWORK`). /cc @wojtek-t ```release-note NONE ```
parents 80bd7510 da01243a
...@@ -1731,12 +1731,6 @@ function create-subnetworks() { ...@@ -1731,12 +1731,6 @@ function create-subnetworks() {
--region ${REGION} \ --region ${REGION} \
${IP_ALIAS_SUBNETWORK} 2>/dev/null) ${IP_ALIAS_SUBNETWORK} 2>/dev/null)
if [[ -z ${subnet} ]]; then if [[ -z ${subnet} ]]; then
# Only allow auto-creation for default subnets
if [[ ${IP_ALIAS_SUBNETWORK} != ${INSTANCE_PREFIX}-subnet-default ]]; then
echo "${color_red}Subnetwork ${NETWORK}:${IP_ALIAS_SUBNETWORK} does not exist${color_norm}"
exit 1
fi
echo "Creating subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}" echo "Creating subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}"
gcloud beta compute networks subnets create \ gcloud beta compute networks subnets create \
${IP_ALIAS_SUBNETWORK} \ ${IP_ALIAS_SUBNETWORK} \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment