Rename client Minions->Nodes, select the correct path for v1beta3

Replaces the client public interface but leaves old references to "minions"
for a later refactor.  Selects the path "nodes" for v1beta3 and "minions"
for older versions.
This commit is contained in:
Clayton Coleman
2014-12-08 00:56:43 -05:00
parent d0087dfe62
commit d1d7505272
15 changed files with 103 additions and 62 deletions

View File

@@ -60,7 +60,7 @@ type REST struct {
podInfoGetter client.PodInfoGetter
podPollPeriod time.Duration
registry Registry
minions client.MinionInterface
nodes client.NodeInterface
ipCache ipCache
clock clock
}
@@ -70,7 +70,7 @@ type RESTConfig struct {
PodCache client.PodInfoGetter
PodInfoGetter client.PodInfoGetter
Registry Registry
Minions client.MinionInterface
Nodes client.NodeInterface
}
// NewREST returns a new REST.
@@ -81,7 +81,7 @@ func NewREST(config *RESTConfig) *REST {
podInfoGetter: config.PodInfoGetter,
podPollPeriod: time.Second * 10,
registry: config.Registry,
minions: config.Minions,
nodes: config.Nodes,
ipCache: ipCache{},
clock: realClock{},
}
@@ -125,7 +125,7 @@ func (rs *REST) Get(ctx api.Context, id string) (runtime.Object, error) {
}
if rs.podCache != nil || rs.podInfoGetter != nil {
rs.fillPodInfo(pod)
status, err := getPodStatus(pod, rs.minions)
status, err := getPodStatus(pod, rs.nodes)
if err != nil {
return pod, err
}
@@ -169,7 +169,7 @@ func (rs *REST) List(ctx api.Context, label, field labels.Selector) (runtime.Obj
for i := range pods.Items {
pod := &pods.Items[i]
rs.fillPodInfo(pod)
status, err := getPodStatus(pod, rs.minions)
status, err := getPodStatus(pod, rs.nodes)
if err != nil {
return pod, err
}

View File

@@ -499,7 +499,7 @@ func TestMakePodStatus(t *testing.T) {
},
}
for _, test := range tests {
if status, err := getPodStatus(test.pod, fakeClient.Minions()); status != test.status {
if status, err := getPodStatus(test.pod, fakeClient.Nodes()); status != test.status {
t.Errorf("In test %s, expected %v, got %v", test.test, test.status, status)
if err != nil {
t.Errorf("In test %s, unexpected error: %v", test.test, err)