From 3f84924095f5959ad046a803fefc16fb773aa258 Mon Sep 17 00:00:00 2001 From: Deyuan Deng Date: Tue, 16 Dec 2014 11:45:27 +0800 Subject: [PATCH] Use constant for port number --- pkg/master/master.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/master/master.go b/pkg/master/master.go index 2bfdaad3004..94b1ca55261 100644 --- a/pkg/master/master.go +++ b/pkg/master/master.go @@ -38,6 +38,7 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/auth/handlers" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider" + "github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/binding" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/controller" "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/endpoint" @@ -422,8 +423,8 @@ func (m *Master) InstallSwaggerAPI() { func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server { serversToValidate := map[string]apiserver.Server{ - "controller-manager": {Addr: "127.0.0.1", Port: 10252, Path: "/healthz"}, - "scheduler": {Addr: "127.0.0.1", Port: 10251, Path: "/healthz"}, + "controller-manager": {Addr: "127.0.0.1", Port: ports.ControllerManagerPort, Path: "/healthz"}, + "scheduler": {Addr: "127.0.0.1", Port: ports.SchedulerPort, Path: "/healthz"}, } for ix, machine := range c.EtcdHelper.Client.GetCluster() { etcdUrl, err := url.Parse(machine) @@ -452,7 +453,7 @@ func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server { glog.Errorf("Failed to list minions: %v", err) } for ix, node := range nodes.Items { - serversToValidate[fmt.Sprintf("node-%d", ix)] = apiserver.Server{Addr: node.Name, Port: 10250, Path: "/healthz"} + serversToValidate[fmt.Sprintf("node-%d", ix)] = apiserver.Server{Addr: node.Name, Port: ports.KubeletPort, Path: "/healthz"} } return serversToValidate }