test-images: server address is now configurable

pull/6/head
Michał Żyłowski 2016-10-21 18:48:34 +02:00
parent 6bda989d54
commit 69a1b1dbbf
2 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
TAG = 1.0
TAG = 1.1
PREFIX = gcr.io/google_containers
all: push

View File

@ -48,8 +48,12 @@ func getEnvInt(name string) int {
}
func main() {
bindAddress := os.Getenv("BIND_ADDRESS")
if bindAddress == "" {
bindAddress = "localhost"
}
bindPort := os.Getenv("BIND_PORT")
listener, err := net.Listen("tcp", fmt.Sprintf("localhost:%s", bindPort))
listener, err := net.Listen("tcp", fmt.Sprintf("%s:%s", bindAddress, bindPort))
if err != nil {
fmt.Printf("Error listening: %v\n", err)
os.Exit(1)