@@ -24,7 +24,6 @@ import (
2424 "k8s.io/apimachinery/pkg/api/errors"
2525 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626 "k8s.io/apimachinery/pkg/runtime/schema"
27- "k8s.io/apimachinery/pkg/types"
2827 clientset "k8s.io/client-go/kubernetes"
2928 "k8s.io/client-go/tools/record"
3029)
@@ -84,10 +83,6 @@ type jobControlInterface interface {
8483 GetJob (namespace , name string ) (* batchv1.Job , error )
8584 // CreateJob creates new Jobs according to the spec.
8685 CreateJob (namespace string , job * batchv1.Job ) (* batchv1.Job , error )
87- // UpdateJob updates a Job.
88- UpdateJob (namespace string , job * batchv1.Job ) (* batchv1.Job , error )
89- // PatchJob patches a Job.
90- PatchJob (namespace string , name string , pt types.PatchType , data []byte , subresources ... string ) (* batchv1.Job , error )
9186 // DeleteJob deletes the Job identified by name.
9287 // TODO: delete by UID?
9388 DeleteJob (namespace string , name string ) error
@@ -105,14 +100,6 @@ func (r realJobControl) GetJob(namespace, name string) (*batchv1.Job, error) {
105100 return r .KubeClient .BatchV1 ().Jobs (namespace ).Get (context .TODO (), name , metav1.GetOptions {})
106101}
107102
108- func (r realJobControl ) UpdateJob (namespace string , job * batchv1.Job ) (* batchv1.Job , error ) {
109- return r .KubeClient .BatchV1 ().Jobs (namespace ).Update (context .TODO (), job , metav1.UpdateOptions {})
110- }
111-
112- func (r realJobControl ) PatchJob (namespace string , name string , pt types.PatchType , data []byte , subresources ... string ) (* batchv1.Job , error ) {
113- return r .KubeClient .BatchV1 ().Jobs (namespace ).Patch (context .TODO (), name , pt , data , metav1.PatchOptions {}, subresources ... )
114- }
115-
116103func (r realJobControl ) CreateJob (namespace string , job * batchv1.Job ) (* batchv1.Job , error ) {
117104 return r .KubeClient .BatchV1 ().Jobs (namespace ).Create (context .TODO (), job , metav1.CreateOptions {})
118105}
@@ -156,28 +143,6 @@ func (f *fakeJobControl) GetJob(namespace, name string) (*batchv1.Job, error) {
156143 return f .Job , nil
157144}
158145
159- func (f * fakeJobControl ) UpdateJob (namespace string , job * batchv1.Job ) (* batchv1.Job , error ) {
160- f .Lock ()
161- defer f .Unlock ()
162- if f .Err != nil {
163- return nil , f .Err
164- }
165- f .UpdateJobName = append (f .UpdateJobName , job .Name )
166- return job , nil
167- }
168-
169- func (f * fakeJobControl ) PatchJob (namespace string , name string , pt types.PatchType , data []byte , subresources ... string ) (* batchv1.Job , error ) {
170- f .Lock ()
171- defer f .Unlock ()
172- if f .Err != nil {
173- return nil , f .Err
174- }
175- f .PatchJobName = append (f .PatchJobName , name )
176- f .Patches = append (f .Patches , data )
177- // We don't have anything to return. Just return something non-nil.
178- return & batchv1.Job {}, nil
179- }
180-
181146func (f * fakeJobControl ) DeleteJob (namespace string , name string ) error {
182147 f .Lock ()
183148 defer f .Unlock ()
@@ -187,11 +152,3 @@ func (f *fakeJobControl) DeleteJob(namespace string, name string) error {
187152 f .DeleteJobName = append (f .DeleteJobName , name )
188153 return nil
189154}
190-
191- func (f * fakeJobControl ) Clear () {
192- f .Lock ()
193- defer f .Unlock ()
194- f .DeleteJobName = []string {}
195- f .Jobs = []batchv1.Job {}
196- f .Err = nil
197- }
0 commit comments