Fix the rest of the code
This commit is contained in:
@@ -107,7 +107,7 @@ func TestReplicationControllerScale(t *testing.T) {
|
||||
if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "replicationcontrollers" || action.GetName() != name {
|
||||
t.Errorf("unexpected action: %v, expected get-replicationController %s", actions[0], name)
|
||||
}
|
||||
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "replicationcontrollers" || action.GetObject().(*api.ReplicationController).Spec.Replicas != int(count) {
|
||||
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "replicationcontrollers" || action.GetObject().(*api.ReplicationController).Spec.Replicas != int32(count) {
|
||||
t.Errorf("unexpected action %v, expected update-replicationController with replicas = %d", actions[1], count)
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@ func (c *ErrorJobs) Update(job *batch.Job) (*batch.Job, error) {
|
||||
}
|
||||
|
||||
func (c *ErrorJobs) Get(name string) (*batch.Job, error) {
|
||||
zero := 0
|
||||
zero := int32(0)
|
||||
return &batch.Job{
|
||||
Spec: batch.JobSpec{
|
||||
Parallelism: &zero,
|
||||
@@ -317,7 +317,7 @@ func TestJobScale(t *testing.T) {
|
||||
if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "jobs" || action.GetName() != name {
|
||||
t.Errorf("unexpected action: %v, expected get-replicationController %s", actions[0], name)
|
||||
}
|
||||
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "jobs" || *action.GetObject().(*batch.Job).Spec.Parallelism != int(count) {
|
||||
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "jobs" || *action.GetObject().(*batch.Job).Spec.Parallelism != int32(count) {
|
||||
t.Errorf("unexpected action %v, expected update-job with parallelism = %d", actions[1], count)
|
||||
}
|
||||
}
|
||||
@@ -342,7 +342,7 @@ func TestJobScaleInvalid(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestJobScaleFailsPreconditions(t *testing.T) {
|
||||
ten := 10
|
||||
ten := int32(10)
|
||||
fake := testclient.NewSimpleFake(&batch.Job{
|
||||
Spec: batch.JobSpec{
|
||||
Parallelism: &ten,
|
||||
@@ -364,7 +364,7 @@ func TestJobScaleFailsPreconditions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestValidateJob(t *testing.T) {
|
||||
zero, ten, twenty := 0, 10, 20
|
||||
zero, ten, twenty := int32(0), int32(10), int32(20)
|
||||
tests := []struct {
|
||||
preconditions ScalePrecondition
|
||||
job batch.Job
|
||||
@@ -557,7 +557,7 @@ func TestDeploymentScale(t *testing.T) {
|
||||
if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "deployments" || action.GetName() != name {
|
||||
t.Errorf("unexpected action: %v, expected get-replicationController %s", actions[0], name)
|
||||
}
|
||||
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "deployments" || action.GetObject().(*extensions.Deployment).Spec.Replicas != int(count) {
|
||||
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "deployments" || action.GetObject().(*extensions.Deployment).Spec.Replicas != int32(count) {
|
||||
t.Errorf("unexpected action %v, expected update-deployment with replicas = %d", actions[1], count)
|
||||
}
|
||||
}
|
||||
@@ -603,7 +603,7 @@ func TestDeploymentScaleFailsPreconditions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestValidateDeployment(t *testing.T) {
|
||||
zero, ten, twenty := 0, 10, 20
|
||||
zero, ten, twenty := int32(0), int32(10), int32(20)
|
||||
tests := []struct {
|
||||
preconditions ScalePrecondition
|
||||
deployment extensions.Deployment
|
||||
|
Reference in New Issue
Block a user