44 "context"
55 "fmt"
66 v1 "github.com/SneaksAndData/arcane-operator/pkg/apis/streaming/v1"
7- "github.com/SneaksAndData/arcane-operator/services"
87 "github.com/SneaksAndData/arcane-operator/services/controllers"
8+ "github.com/SneaksAndData/arcane-operator/services/job"
99 batchv1 "k8s.io/api/batch/v1"
1010 "k8s.io/apimachinery/pkg/api/errors"
1111 "k8s.io/apimachinery/pkg/api/meta"
@@ -113,8 +113,8 @@ func (s *streamReconciler) Reconcile(ctx context.Context, request reconcile.Requ
113113 return reconcile.Result {}, err
114114 }
115115
116- job := & batchv1.Job {}
117- err = s .client .Get (ctx , request .NamespacedName , job )
116+ j := & batchv1.Job {}
117+ err = s .client .Get (ctx , request .NamespacedName , j )
118118
119119 if client .IgnoreNotFound (err ) != nil { // coverage-ignore
120120 logger .V (1 ).Error (err , "unable to fetch Stream Job" )
@@ -127,7 +127,7 @@ func (s *streamReconciler) Reconcile(ctx context.Context, request reconcile.Requ
127127 streamingJob = nil
128128 logger .V (2 ).Info ("streaming does not exist" )
129129 } else {
130- streamingJob = (* StreamingJob )(job )
130+ streamingJob = (* StreamingJob )(j )
131131 logger .V (2 ).Info ("streaming job found" )
132132 }
133133
@@ -186,10 +186,10 @@ func (s *streamReconciler) moveFsm(ctx context.Context, definition Definition, j
186186}
187187
188188func (s * streamReconciler ) stopStream (ctx context.Context , definition Definition , nextPhase Phase ) (reconcile.Result , error ) {
189- job := & batchv1.Job {}
190- job .SetName (definition .NamespacedName ().Name )
191- job .SetNamespace (definition .NamespacedName ().Namespace )
192- err := s .client .Delete (ctx , job , client .PropagationPolicy (metav1 .DeletePropagationBackground ))
189+ j := & batchv1.Job {}
190+ j .SetName (definition .NamespacedName ().Name )
191+ j .SetNamespace (definition .NamespacedName ().Namespace )
192+ err := s .client .Delete (ctx , j , client .PropagationPolicy (metav1 .DeletePropagationBackground ))
193193 if client .IgnoreNotFound (err ) != nil { // coverage-ignore
194194 return reconcile.Result {}, err
195195 }
@@ -231,9 +231,9 @@ func (s *streamReconciler) reconcileJob(ctx context.Context, definition Definiti
231231 return reconcile.Result {}, err
232232 }
233233
234- templateType := services .StreamingJobTemplate
234+ templateType := job .StreamingJobTemplate
235235 if backfillRequest != nil {
236- templateType = services .BackfillJobTemplate
236+ templateType = job .BackfillJobTemplate
237237 }
238238 configurator := definition .ToConfiguratorProvider ().JobConfigurator ().AddNext (backfillRequest .JobConfigurator ())
239239
@@ -305,13 +305,13 @@ func (s *streamReconciler) completeBackfill(ctx context.Context, job *batchv1.Jo
305305 return s .updateStreamPhase (ctx , definition , nil , nextStatus )
306306}
307307
308- func (s * streamReconciler ) startNewJob (ctx context.Context , templateType services. JobTemplateType , configurator services. JobConfigurator ) error {
309- job , err := s .jobBuilder .BuildJob (ctx , templateType , configurator )
308+ func (s * streamReconciler ) startNewJob (ctx context.Context , templateType job. TemplateType , configurator job. Configurator ) error {
309+ j , err := s .jobBuilder .BuildJob (ctx , templateType , configurator )
310310 if err != nil { // coverage-ignore
311311 return err
312312 }
313313
314- err = s .client .Create (ctx , job )
314+ err = s .client .Create (ctx , j )
315315 if err != nil { // coverage-ignore
316316 return err
317317 }
0 commit comments