@@ -51,12 +51,12 @@ func TestValidatingHandle(t *testing.T) {
5151 decoder := admission .NewDecoder (scheme )
5252
5353 aksServiceUser := authenticationv1.UserInfo {
54- Username : AKSServiceUserName ,
55- Groups : []string {SystemMastersGroup },
54+ Username : utils . AKSServiceUserName ,
55+ Groups : []string {utils . SystemMastersGroup },
5656 }
5757
5858 aksServiceUserNoMasters := authenticationv1.UserInfo {
59- Username : AKSServiceUserName ,
59+ Username : utils . AKSServiceUserName ,
6060 Groups : []string {"system:authenticated" },
6161 }
6262
@@ -67,7 +67,7 @@ func TestValidatingHandle(t *testing.T) {
6767
6868 regularUserWithMasters := authenticationv1.UserInfo {
6969 Username : "regular-user" ,
70- Groups : []string {SystemMastersGroup , "system:authenticated" },
70+ Groups : []string {utils . SystemMastersGroup , "system:authenticated" },
7171 }
7272
7373 // Deployment without the reconcile label.
@@ -357,51 +357,51 @@ func TestIsAKSService(t *testing.T) {
357357 }{
358358 "aksService with system:masters" : {
359359 userInfo : authenticationv1.UserInfo {
360- Username : AKSServiceUserName ,
361- Groups : []string {SystemMastersGroup },
360+ Username : utils . AKSServiceUserName ,
361+ Groups : []string {utils . SystemMastersGroup },
362362 },
363363 want : true ,
364364 },
365365 "aksService with system:masters and other groups" : {
366366 userInfo : authenticationv1.UserInfo {
367- Username : AKSServiceUserName ,
368- Groups : []string {"system:authenticated" , SystemMastersGroup , "custom-group" },
367+ Username : utils . AKSServiceUserName ,
368+ Groups : []string {"system:authenticated" , utils . SystemMastersGroup , "custom-group" },
369369 },
370370 want : true ,
371371 },
372372 "aksService without system:masters" : {
373373 userInfo : authenticationv1.UserInfo {
374- Username : AKSServiceUserName ,
374+ Username : utils . AKSServiceUserName ,
375375 Groups : []string {"system:authenticated" },
376376 },
377377 want : false ,
378378 },
379379 "aksService with empty groups" : {
380380 userInfo : authenticationv1.UserInfo {
381- Username : AKSServiceUserName ,
381+ Username : utils . AKSServiceUserName ,
382382 Groups : []string {},
383383 },
384384 want : false ,
385385 },
386386 "regular user with system:masters" : {
387387 userInfo : authenticationv1.UserInfo {
388388 Username : "regular-user" ,
389- Groups : []string {SystemMastersGroup },
389+ Groups : []string {utils . SystemMastersGroup },
390390 },
391391 want : false ,
392392 },
393393 "empty username with system:masters" : {
394394 userInfo : authenticationv1.UserInfo {
395395 Username : "" ,
396- Groups : []string {SystemMastersGroup },
396+ Groups : []string {utils . SystemMastersGroup },
397397 },
398398 want : false ,
399399 },
400400 }
401401
402402 for testName , tc := range testCases {
403403 t .Run (testName , func (t * testing.T ) {
404- got := isAKSService (tc .userInfo )
404+ got := utils . IsAKSService (tc .userInfo )
405405 if got != tc .want {
406406 t .Errorf ("isAKSService(%+v) = %v, want %v" , tc .userInfo , got , tc .want )
407407 }
0 commit comments