Merge pull request #25475 from soltysh/scheduledjob_client

Automatic merge from submit-queue

ScheduledJob client 

@erictune SheduledJob part 2, based on #24970 so first two commits doesn't count. 
This is still WIP, but it's here so you know :)

```release-note
Introducing ScheduledJobs as described in [the proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/scheduledjob.md) as part of `batch/v2alpha1` version (experimental feature).
```
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
This commit is contained in:
k8s-merge-robot
2016-05-21 14:10:41 -07:00
32 changed files with 1891 additions and 90 deletions

View File

@@ -249,7 +249,7 @@ func TestValidateReplicationController(t *testing.T) {
}
type ErrorJobs struct {
testclient.FakeJobs
testclient.FakeJobsV1
invalid bool
}
@@ -270,16 +270,16 @@ func (c *ErrorJobs) Get(name string) (*batch.Job, error) {
}
type ErrorJobClient struct {
testclient.FakeExperimental
testclient.FakeBatch
invalid bool
}
func (c *ErrorJobClient) Jobs(namespace string) client.JobInterface {
return &ErrorJobs{testclient.FakeJobs{Fake: &c.FakeExperimental, Namespace: namespace}, c.invalid}
return &ErrorJobs{testclient.FakeJobsV1{Fake: &c.FakeBatch, Namespace: namespace}, c.invalid}
}
func TestJobScaleRetry(t *testing.T) {
fake := &ErrorJobClient{FakeExperimental: testclient.FakeExperimental{}, invalid: false}
fake := &ErrorJobClient{FakeBatch: testclient.FakeBatch{}, invalid: false}
scaler := JobScaler{fake}
preconditions := ScalePrecondition{-1, ""}
count := uint(3)
@@ -303,7 +303,7 @@ func TestJobScaleRetry(t *testing.T) {
}
func TestJobScale(t *testing.T) {
fake := &testclient.FakeExperimental{Fake: &testclient.Fake{}}
fake := &testclient.FakeBatch{Fake: &testclient.Fake{}}
scaler := JobScaler{fake}
preconditions := ScalePrecondition{-1, ""}
count := uint(3)
@@ -323,7 +323,7 @@ func TestJobScale(t *testing.T) {
}
func TestJobScaleInvalid(t *testing.T) {
fake := &ErrorJobClient{FakeExperimental: testclient.FakeExperimental{}, invalid: true}
fake := &ErrorJobClient{FakeBatch: testclient.FakeBatch{}, invalid: true}
scaler := JobScaler{fake}
preconditions := ScalePrecondition{-1, ""}
count := uint(3)
@@ -348,7 +348,7 @@ func TestJobScaleFailsPreconditions(t *testing.T) {
Parallelism: &ten,
},
})
scaler := JobScaler{&testclient.FakeExperimental{Fake: fake}}
scaler := JobScaler{&testclient.FakeBatch{Fake: fake}}
preconditions := ScalePrecondition{2, ""}
count := uint(3)
name := "foo"