Revert "Use scale subresource"

This commit is contained in:
Wojciech Tyczynski
2016-09-10 18:35:07 +02:00
committed by GitHub
parent 4389446d4e
commit e240aff741
4 changed files with 270 additions and 130 deletions

View File

@@ -69,11 +69,6 @@ func TestReplicationControllerStop(t *testing.T) {
},
},
},
&extensions.Scale{
Spec: extensions.ScaleSpec{
Replicas: 0,
},
},
},
StopError: nil,
ExpectedActions: []string{"get", "list", "get", "update", "get", "delete"},
@@ -112,11 +107,6 @@ func TestReplicationControllerStop(t *testing.T) {
},
},
},
&extensions.Scale{
Spec: extensions.ScaleSpec{
Replicas: 0,
},
},
},
StopError: nil,
ExpectedActions: []string{"get", "list", "get", "update", "get", "delete"},
@@ -279,7 +269,7 @@ func TestReplicationControllerStop(t *testing.T) {
continue
}
for i, verb := range test.ExpectedActions {
if actions[i].GetResource() != "replicationcontrollers" && actions[i].GetSubresource() != "scale" {
if actions[i].GetResource() != "replicationcontrollers" {
t.Errorf("%s unexpected action: %+v, expected %s-replicationController", test.Name, actions[i], verb)
}
if actions[i].GetVerb() != verb {
@@ -325,11 +315,6 @@ func TestReplicaSetStop(t *testing.T) {
},
},
},
&extensions.Scale{
Spec: extensions.ScaleSpec{
Replicas: 0,
},
},
},
StopError: nil,
ExpectedActions: []string{"get", "get", "update", "get", "get", "delete"},
@@ -371,11 +356,6 @@ func TestReplicaSetStop(t *testing.T) {
},
},
},
&extensions.Scale{
Spec: extensions.ScaleSpec{
Replicas: 0,
},
},
},
StopError: nil,
ExpectedActions: []string{"get", "get", "update", "get", "get", "delete"},
@@ -399,7 +379,7 @@ func TestReplicaSetStop(t *testing.T) {
continue
}
for i, verb := range test.ExpectedActions {
if actions[i].GetResource() != "replicasets" && actions[i].GetSubresource() != "scale" {
if actions[i].GetResource() != "replicasets" {
t.Errorf("%s unexpected action: %+v, expected %s-replicaSet", test.Name, actions[i], verb)
}
if actions[i].GetVerb() != verb {
@@ -591,11 +571,6 @@ func TestDeploymentStop(t *testing.T) {
},
},
},
&extensions.Scale{
Spec: extensions.ScaleSpec{
Replicas: 0,
},
},
},
StopError: nil,
ExpectedActions: []string{"get:deployments", "update:deployments",
@@ -624,7 +599,7 @@ func TestDeploymentStop(t *testing.T) {
if actions[i].GetVerb() != action[0] {
t.Errorf("%s unexpected verb: %+v, expected %s", test.Name, actions[i], expAction)
}
if actions[i].GetResource() != action[1] && actions[i].GetSubresource() != "scale" {
if actions[i].GetResource() != action[1] {
t.Errorf("%s unexpected resource: %+v, expected %s", test.Name, actions[i], expAction)
}
if len(action) == 3 && actions[i].GetSubresource() != action[2] {