From 009ed57719af688c3c199429ae1ffc560de19077 Mon Sep 17 00:00:00 2001 From: Olivier Gambier Date: Sat, 12 Sep 2015 22:10:54 -0700 Subject: [PATCH] Fix #1846 Signed-off-by: Olivier Gambier --- libmachine/host.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmachine/host.go b/libmachine/host.go index 8be393b32e..35641a49a5 100644 --- a/libmachine/host.go +++ b/libmachine/host.go @@ -24,8 +24,8 @@ import ( ) var ( - validHostNameChars = `[a-zA-Z0-9\-\.]` - validHostNamePattern = regexp.MustCompile(`^` + validHostNameChars + `+$`) + validHostNameChars = `^[a-zA-Z0-9][a-zA-Z0-9\-\.]*$` + validHostNamePattern = regexp.MustCompile(validHostNameChars) errMachineMustBeRunningForUpgrade = errors.New("Error: machine must be running to upgrade.") stateTimeoutDuration = time.Second * 3 )