mirror of https://github.com/k3s-io/k3s
Merge pull request #48735 from nicksardo/gce-empty-network-proj
Automatic merge from submit-queue (batch tested with PRs 48698, 48712, 48516, 48734, 48735) GCE: Allow empty NETWORK_PROJECT_ID env var Changes: 1. Adds `GCE_API_ENDPOINT` logic to container-linux as it was added to GCI in #47881. 1. Apply `NETWORK_PROJECT_ID` value to gce.conf only if the env var is set. /sig network /area platform/gce **Release note**: ```release-note NONE ```pull/6/head
commit
787f5e0fe5
|
@ -224,15 +224,24 @@ function create-master-auth {
|
|||
cat <<EOF >/etc/gce.conf
|
||||
[global]
|
||||
EOF
|
||||
if [[ -n "${GCE_API_ENDPOINT:-}" ]]; then
|
||||
cat <<EOF >>/etc/gce.conf
|
||||
api-endpoint = ${GCE_API_ENDPOINT}
|
||||
EOF
|
||||
fi
|
||||
if [[ -n "${PROJECT_ID:-}" && -n "${TOKEN_URL:-}" && -n "${TOKEN_BODY:-}" && -n "${NODE_NETWORK:-}" ]]; then
|
||||
use_cloud_config="true"
|
||||
cat <<EOF >>/etc/gce.conf
|
||||
token-url = ${TOKEN_URL}
|
||||
token-body = ${TOKEN_BODY}
|
||||
project-id = ${PROJECT_ID}
|
||||
network-project-id = ${NETWORK_PROJECT_ID}
|
||||
network-name = ${NODE_NETWORK}
|
||||
EOF
|
||||
if [[ -n "${NETWORK_PROJECT_ID:-}" ]]; then
|
||||
cat <<EOF >>/etc/gce.conf
|
||||
network-project-id = ${NETWORK_PROJECT_ID}
|
||||
EOF
|
||||
fi
|
||||
if [[ -n "${NODE_SUBNETWORK:-}" ]]; then
|
||||
cat <<EOF >>/etc/gce.conf
|
||||
subnetwork-name = ${NODE_SUBNETWORK}
|
||||
|
|
|
@ -390,9 +390,13 @@ EOF
|
|||
token-url = ${TOKEN_URL}
|
||||
token-body = ${TOKEN_BODY}
|
||||
project-id = ${PROJECT_ID}
|
||||
network-project-id = ${NETWORK_PROJECT_ID}
|
||||
network-name = ${NODE_NETWORK}
|
||||
EOF
|
||||
if [[ -n "${NETWORK_PROJECT_ID:-}" ]]; then
|
||||
cat <<EOF >>/etc/gce.conf
|
||||
network-project-id = ${NETWORK_PROJECT_ID}
|
||||
EOF
|
||||
fi
|
||||
if [[ -n "${NODE_SUBNETWORK:-}" ]]; then
|
||||
cat <<EOF >>/etc/gce.conf
|
||||
subnetwork-name = ${NODE_SUBNETWORK}
|
||||
|
|
Loading…
Reference in New Issue