Skip to content

Commit

Permalink
kola/tests/kubernetes: Use correct GCE variable
Browse files Browse the repository at this point in the history
There are no FLATCAR_*_IP* variables set up in
/etc/environment for machines running in
Google Compute Engine but only COREOS_GCE_IP_LOCAL_0
and COREOS_GCE_IP_EXTERNAL_0 in /run/metadata/flatcar.
  • Loading branch information
pothos committed Mar 5, 2020
1 parent 291c363 commit b821e1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kola/tests/kubernetes/controllerInstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package kubernetes

// https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic.
// The only change besides paramaterizing the env vars was:
// s/FLATCAR_PUBLIC_IP/FLATCAR_PRIVATE so this works on GCE.
// s/COREOS_PUBLIC_IP/COREOS_GCE_IP_LOCAL_0 so this works on GCE.
const controllerInstallScript = `#!/bin/bash
set -e
Expand Down Expand Up @@ -54,7 +54,7 @@ function init_config {
fi
if [ -z $ADVERTISE_IP ]; then
export ADVERTISE_IP=$(awk -F= '/FLATCAR_PRIVATE_IPV4/ {print $2}' /etc/environment)
export ADVERTISE_IP=$(awk -F= '/COREOS_GCE_IP_LOCAL_0/ {print $2}' /run/metadata/flatcar)
fi
for REQ in "${REQUIRED[@]}"; do
Expand Down
4 changes: 2 additions & 2 deletions kola/tests/kubernetes/workerInstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package kubernetes

// https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic.
// The only change besides paramaterizing the env vars was:
// s/FLATCAR_PUBLIC_IP/FLATCAR_PRIVATE so this works on GCE.
// s/COREOS_PUBLIC_IP/COREOS_GCE_IP_LOCAL_0 so this works on GCE.
const workerInstallScript = `#!/bin/bash
set -e
Expand Down Expand Up @@ -43,7 +43,7 @@ function init_config {
fi
if [ -z $ADVERTISE_IP ]; then
export ADVERTISE_IP=$(awk -F= '/FLATCAR_PRIVATE_IPV4/ {print $2}' /etc/environment)
export ADVERTISE_IP=$(awk -F= '/COREOS_GCE_IP_LOCAL_0/ {print $2}' /run/metadata/flatcar)
fi
for REQ in "${REQUIRED[@]}"; do
Expand Down

0 comments on commit b821e1d

Please sign in to comment.