@@ -28,10 +28,6 @@ import (
28
28
utilrand "k8s.io/apimachinery/pkg/util/rand"
29
29
clientgotesting "k8s.io/client-go/testing"
30
30
"k8s.io/utils/ptr"
31
- fakeeventingclient "knative.dev/eventing/pkg/client/injection/client/fake"
32
- jobsinkreconciler "knative.dev/eventing/pkg/client/injection/reconciler/sinks/v1alpha1/jobsink"
33
- . "knative.dev/eventing/pkg/reconciler/testing/v1"
34
- . "knative.dev/eventing/pkg/reconciler/testing/v1alpha1"
35
31
"knative.dev/pkg/apis"
36
32
duckv1 "knative.dev/pkg/apis/duck/v1"
37
33
v1 "knative.dev/pkg/client/injection/ducks/duck/v1/addressable"
@@ -40,6 +36,12 @@ import (
40
36
logtesting "knative.dev/pkg/logging/testing"
41
37
"knative.dev/pkg/network"
42
38
. "knative.dev/pkg/reconciler/testing"
39
+
40
+ "knative.dev/eventing/pkg/apis/sinks/v1alpha1"
41
+ fakeeventingclient "knative.dev/eventing/pkg/client/injection/client/fake"
42
+ jobsinkreconciler "knative.dev/eventing/pkg/client/injection/reconciler/sinks/v1alpha1/jobsink"
43
+ . "knative.dev/eventing/pkg/reconciler/testing/v1"
44
+ . "knative.dev/eventing/pkg/reconciler/testing/v1alpha1"
43
45
)
44
46
45
47
const (
@@ -198,6 +200,36 @@ func TestReconcile(t *testing.T) {
198
200
},
199
201
},
200
202
},
203
+ {
204
+ Name : "Successful reconciliation, observed generation" ,
205
+ Key : testKey ,
206
+ Objects : []runtime.Object {
207
+ NewJobSink (jobSinkName , testNamespace ,
208
+ func (sink * v1alpha1.JobSink ) {
209
+ sink .Generation = 4242
210
+ },
211
+ WithJobSinkJob (testJob ("" )),
212
+ WithInitJobSinkConditions ),
213
+ },
214
+ WantErr : false ,
215
+ WantCreates : []runtime.Object {
216
+ testJob ("test-jobSinkml6mm" ),
217
+ },
218
+ WantStatusUpdates : []clientgotesting.UpdateActionImpl {
219
+ {
220
+ Object : NewJobSink (jobSinkName , testNamespace ,
221
+ WithJobSinkJob (testJob ("" )),
222
+ WithJobSinkAddressableReady (),
223
+ WithJobSinkJobStatusSelector (),
224
+ WithJobSinkAddress (& jobSinkAddressable ),
225
+ func (sink * v1alpha1.JobSink ) {
226
+ sink .Generation = 4242
227
+ sink .Status .ObservedGeneration = 4242
228
+ },
229
+ WithJobSinkEventPoliciesReadyBecauseOIDCDisabled ()),
230
+ },
231
+ },
232
+ },
201
233
}
202
234
203
235
logger := logtesting .TestLogger (t )
0 commit comments