experimental. -> extensions.
This commit is contained in:
@@ -53,17 +53,17 @@ type ErrorJobs struct {
|
||||
invalid bool
|
||||
}
|
||||
|
||||
func (c *ErrorJobs) Update(job *experimental.Job) (*experimental.Job, error) {
|
||||
func (c *ErrorJobs) Update(job *extensions.Job) (*extensions.Job, error) {
|
||||
if c.invalid {
|
||||
return nil, kerrors.NewInvalid(job.Kind, job.Name, nil)
|
||||
}
|
||||
return nil, errors.New("Job update failure")
|
||||
}
|
||||
|
||||
func (c *ErrorJobs) Get(name string) (*experimental.Job, error) {
|
||||
func (c *ErrorJobs) Get(name string) (*extensions.Job, error) {
|
||||
zero := 0
|
||||
return &experimental.Job{
|
||||
Spec: experimental.JobSpec{
|
||||
return &extensions.Job{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &zero,
|
||||
},
|
||||
}, nil
|
||||
@@ -325,7 +325,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().(*experimental.Job).Spec.Parallelism != int(count) {
|
||||
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "jobs" || *action.GetObject().(*extensions.Job).Spec.Parallelism != int(count) {
|
||||
t.Errorf("unexpected action %v, expected update-job with parallelism = %d", actions[1], count)
|
||||
}
|
||||
}
|
||||
@@ -351,8 +351,8 @@ func TestJobScaleInvalid(t *testing.T) {
|
||||
|
||||
func TestJobScaleFailsPreconditions(t *testing.T) {
|
||||
ten := 10
|
||||
fake := testclient.NewSimpleFake(&experimental.Job{
|
||||
Spec: experimental.JobSpec{
|
||||
fake := testclient.NewSimpleFake(&extensions.Job{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &ten,
|
||||
},
|
||||
})
|
||||
@@ -375,7 +375,7 @@ func TestValidateJob(t *testing.T) {
|
||||
zero, ten, twenty := 0, 10, 20
|
||||
tests := []struct {
|
||||
preconditions ScalePrecondition
|
||||
job experimental.Job
|
||||
job extensions.Job
|
||||
expectError bool
|
||||
test string
|
||||
}{
|
||||
@@ -386,11 +386,11 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{-1, ""},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "foo",
|
||||
},
|
||||
Spec: experimental.JobSpec{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &ten,
|
||||
},
|
||||
},
|
||||
@@ -399,11 +399,11 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{0, ""},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "foo",
|
||||
},
|
||||
Spec: experimental.JobSpec{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &zero,
|
||||
},
|
||||
},
|
||||
@@ -412,11 +412,11 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{-1, "foo"},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "foo",
|
||||
},
|
||||
Spec: experimental.JobSpec{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &ten,
|
||||
},
|
||||
},
|
||||
@@ -425,11 +425,11 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{10, "foo"},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "foo",
|
||||
},
|
||||
Spec: experimental.JobSpec{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &ten,
|
||||
},
|
||||
},
|
||||
@@ -438,11 +438,11 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{10, "foo"},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "foo",
|
||||
},
|
||||
Spec: experimental.JobSpec{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &twenty,
|
||||
},
|
||||
},
|
||||
@@ -451,7 +451,7 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{10, "foo"},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "foo",
|
||||
},
|
||||
@@ -461,11 +461,11 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{10, "foo"},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "bar",
|
||||
},
|
||||
Spec: experimental.JobSpec{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &ten,
|
||||
},
|
||||
},
|
||||
@@ -474,11 +474,11 @@ func TestValidateJob(t *testing.T) {
|
||||
},
|
||||
{
|
||||
preconditions: ScalePrecondition{10, "foo"},
|
||||
job: experimental.Job{
|
||||
job: extensions.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ResourceVersion: "bar",
|
||||
},
|
||||
Spec: experimental.JobSpec{
|
||||
Spec: extensions.JobSpec{
|
||||
Parallelism: &twenty,
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user