Skip to content

Commit

Permalink
Remove unused and not completely correct code
Browse files Browse the repository at this point in the history
  • Loading branch information
lavalamp committed Aug 16, 2014
1 parent 12a22db commit 26e2256
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 640 deletions.
34 changes: 14 additions & 20 deletions cmd/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func main() {
verflag.PrintAndExitIfRequested()
verifyMinionFlags()

if len(etcdServerList) == 0 {
glog.Fatalf("-etcd_servers flag is required.")
}

var cloud cloudprovider.Interface
switch *cloudProvider {
case "gce":
Expand All @@ -94,26 +98,16 @@ func main() {

client := client.New("http://"+net.JoinHostPort(*address, strconv.Itoa(int(*port))), nil)

var m *master.Master
if len(etcdServerList) > 0 {
m = master.New(&master.Config{
Client: client,
Cloud: cloud,
EtcdServers: etcdServerList,
HealthCheckMinions: *healthCheckMinions,
Minions: machineList,
MinionCacheTTL: *minionCacheTTL,
MinionRegexp: *minionRegexp,
PodInfoGetter: podInfoGetter,
})
} else {
m = master.NewMemoryServer(&master.Config{
Client: client,
Cloud: cloud,
Minions: machineList,
PodInfoGetter: podInfoGetter,
})
}
m := master.New(&master.Config{
Client: client,
Cloud: cloud,
EtcdServers: etcdServerList,
HealthCheckMinions: *healthCheckMinions,
Minions: machineList,
MinionCacheTTL: *minionCacheTTL,
MinionRegexp: *minionRegexp,
PodInfoGetter: podInfoGetter,
})

storage, codec := m.API_v1beta1()
s := &http.Server{
Expand Down
14 changes: 0 additions & 14 deletions pkg/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/controller"
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/endpoint"
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/etcd"
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/memory"
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/minion"
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/pod"
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/service"
Expand Down Expand Up @@ -61,19 +60,6 @@ type Master struct {
client *client.Client
}

// NewMemoryServer returns a new instance of Master backed with memory (not etcd).
func NewMemoryServer(c *Config) *Master {
m := &Master{
podRegistry: memory.NewRegistry(),
controllerRegistry: memory.NewRegistry(),
serviceRegistry: memory.NewRegistry(),
minionRegistry: minion.NewRegistry(c.Minions),
client: c.Client,
}
m.init(c.Cloud, c.PodInfoGetter)
return m
}

// New returns a new instance of Master connected to the given etcdServer.
func New(c *Config) *Master {
etcdClient := goetcd.NewClient(c.EtcdServers)
Expand Down
191 changes: 0 additions & 191 deletions pkg/registry/memory/memory.go

This file was deleted.

Loading

0 comments on commit 26e2256

Please sign in to comment.