@@ -318,12 +318,12 @@ func TestEmptyAuthConfigIdentitiesDefaultsToAnonymousAccess(t *testing.T) {
318318 assert .Equal (t , len (config .IdentityConfigs ), 1 )
319319}
320320
321- func TestEmptyIndex (t * testing.T ) {
321+ func TestBootstrapIndex (t * testing.T ) {
322322 mockController := gomock .NewController (t )
323323 defer mockController .Finish ()
324324 indexMock := mock_index .NewMockIndex (mockController )
325325
326- authConfig := newTestAuthConfig (map [string ]string {})
326+ authConfig := newTestAuthConfig (map [string ]string {"scope" : "in" })
327327 authConfig .Status .Summary = api.Summary {
328328 Ready : true ,
329329 HostsReady : authConfig .Spec .Hosts ,
@@ -334,11 +334,25 @@ func TestEmptyIndex(t *testing.T) {
334334 NumResponseItems : int64 (len (authConfig .Spec .Response )),
335335 FestivalWristbandEnabled : false ,
336336 }
337+
338+ authConfigOutOfScope := newTestAuthConfig (map [string ]string {"scope" : "out" })
339+ authConfigOutOfScope .Status .Summary = api.Summary {
340+ Ready : true ,
341+ HostsReady : authConfig .Spec .Hosts ,
342+ NumHostsReady : fmt .Sprintf ("%d/%d" , len (authConfig .Spec .Hosts ), len (authConfig .Spec .Hosts )),
343+ NumIdentitySources : int64 (len (authConfig .Spec .Identity )),
344+ NumMetadataSources : int64 (len (authConfig .Spec .Metadata )),
345+ NumAuthorizationPolicies : int64 (len (authConfig .Spec .Authorization )),
346+ NumResponseItems : int64 (len (authConfig .Spec .Response )),
347+ FestivalWristbandEnabled : false ,
348+ }
349+
337350 authConfigName := types.NamespacedName {Name : authConfig .Name , Namespace : authConfig .Namespace }
338351 resourceId := authConfigName .String ()
339352 secret := newTestOAuthClientSecret ()
340353 client := newTestK8sClient (& authConfig , & secret )
341354 reconciler := newTestAuthConfigReconciler (client , indexMock )
355+ reconciler .LabelSelector = ToLabelSelector ("scope=in" )
342356
343357 indexMock .EXPECT ().Empty ().Return (true )
344358 indexMock .EXPECT ().FindKeys (resourceId ).Return ([]string {}).AnyTimes ()
0 commit comments