Delete overlapping controllers, add clarity to docs

This commit is contained in:
Prashanth Balasubramanian
2015-06-29 18:29:53 -07:00
parent 0b14613361
commit f4fe40e2d1
5 changed files with 92 additions and 16 deletions

View File

@@ -27,14 +27,19 @@ import (
)
func TestReplicationControllerStop(t *testing.T) {
name := "foo"
ns := "default"
fake := testclient.NewSimpleFake(&api.ReplicationController{
ObjectMeta: api.ObjectMeta{
Name: name,
Namespace: ns,
},
Spec: api.ReplicationControllerSpec{
Replicas: 0,
},
})
reaper := ReplicationControllerReaper{fake, time.Millisecond, time.Millisecond}
name := "foo"
s, err := reaper.Stop("default", name, 0, nil)
s, err := reaper.Stop(ns, name, 0, nil)
if err != nil {
t.Errorf("unexpected error: %v", err)
}
@@ -42,12 +47,12 @@ func TestReplicationControllerStop(t *testing.T) {
if s != expected {
t.Errorf("expected %s, got %s", expected, s)
}
if len(fake.Actions) != 6 {
t.Errorf("unexpected actions: %v, expected 6 actions (get, get, update, get, get, delete)", fake.Actions)
if len(fake.Actions) != 7 {
t.Errorf("unexpected actions: %v, expected 6 actions (get, list, get, update, get, get, delete)", fake.Actions)
}
for i, action := range []string{"get", "get", "update", "get", "get", "delete"} {
for i, action := range []string{"get", "list", "get", "update", "get", "get", "delete"} {
if fake.Actions[i].Action != action+"-replicationController" {
t.Errorf("unexpected action: %v, expected %s-replicationController", fake.Actions[i], action)
t.Errorf("unexpected action: %+v, expected %s-replicationController", fake.Actions[i], action)
}
}
}