Browse code

Move hostname detection warning to runtime

Jordan Liggitt authored on 2015/04/07 01:45:00
Showing 2 changed files
... ...
@@ -7,6 +7,7 @@ import (
7 7
 
8 8
 	"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
9 9
 	"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/dockertools"
10
+	"github.com/golang/glog"
10 11
 
11 12
 	configapi "github.com/openshift/origin/pkg/cmd/server/api"
12 13
 	"github.com/openshift/origin/pkg/cmd/server/crypto"
... ...
@@ -59,6 +60,10 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig) (*NodeConfig, error
59 59
 		return nil, err
60 60
 	}
61 61
 
62
+	if options.NodeName == "localhost" {
63
+		glog.Warningf(`Using "localhost" as node name will not resolve from all locations`)
64
+	}
65
+
62 66
 	var dnsIP net.IP
63 67
 	if len(options.DNSIP) > 0 {
64 68
 		dnsIP = net.ParseIP(options.DNSIP)
... ...
@@ -10,7 +10,6 @@ import (
10 10
 	"strings"
11 11
 
12 12
 	"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
13
-	"github.com/golang/glog"
14 13
 	"github.com/spf13/pflag"
15 14
 
16 15
 	"github.com/openshift/origin/pkg/cmd/server/admin"
... ...
@@ -50,7 +49,6 @@ func NewDefaultNodeArgs() *NodeArgs {
50 50
 	hostname, err := defaultHostname()
51 51
 	if err != nil {
52 52
 		hostname = "localhost"
53
-		glog.Warningf("Unable to lookup hostname, using %q: %v", hostname, err)
54 53
 	}
55 54
 
56 55
 	var dnsIP net.IP