@@ -608,7 +608,7 @@ func TestCreateContainerApplication(t *testing.T) {
608608 sApp .EXPECT ().Get (appView .Namespace , "eden2" , "" ).Return (eden2 , nil ).Return (eden2 , nil ).Times (1 )
609609 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), eden2 ).Return (eden2 , nil )
610610 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
611- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
611+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
612612 sSecret .EXPECT ().Get (appView .Namespace , "secret01" , "" ).Return (secret , nil ).Times (1 )
613613 w = httptest .NewRecorder ()
614614 body , _ = json .Marshal (appView )
@@ -801,7 +801,7 @@ func TestCreateApplicationHasCertificates(t *testing.T) {
801801 sApp .EXPECT ().Get (appView .Namespace , "abc" , "" ).Return (nil , common .Error (common .ErrResourceNotFound )).Times (1 )
802802 sApp .EXPECT ().CreateWithBase (appView .Namespace , app , nil ).Return (app , nil )
803803 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
804- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
804+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
805805 sSecret .EXPECT ().Get (appView .Namespace , "secret01" , "" ).Return (secret , nil ).Times (1 )
806806 sSecret .EXPECT ().Get (appView .Namespace , "registry01" , "" ).Return (secretRegistry , nil ).Times (1 )
807807 sSecret .EXPECT ().Get (appView .Namespace , "certificate01" , "" ).Return (secretCertificate , nil ).Times (1 )
@@ -862,7 +862,7 @@ func TestUpdateContainerApplication(t *testing.T) {
862862
863863 sApp .EXPECT ().Get (gomock .Any (), "abc" , gomock .Any ()).Return (mApp , nil ).AnyTimes ()
864864 sApp .EXPECT ().Update (mApp .Namespace , gomock .Any ()).Return (mApp2 , nil )
865- sIndex .EXPECT ().RefreshNodesIndexByApp (mApp .Namespace , mApp .Name , gomock .Any ()).Return (nil ).Times (2 )
865+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , mApp .Namespace , mApp .Name , gomock .Any ()).Return (nil ).Times (2 )
866866 sNode .EXPECT ().DeleteNodeAppVersion (gomock .Any (), gomock .Any ()).Return (nil , nil )
867867 sNode .EXPECT ().UpdateNodeAppVersion (gomock .Any (), gomock .Any ()).Return ([]string {}, nil )
868868 w = httptest .NewRecorder ()
@@ -1043,7 +1043,7 @@ func TestUpdateNativeNotFunctionApplication(t *testing.T) {
10431043 sApp .EXPECT ().Get (appView .Namespace , "abc" , "" ).Return (nil , common .Error (common .ErrResourceNotFound )).Times (1 )
10441044 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), nil ).Return (app1 , nil )
10451045 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
1046- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
1046+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
10471047 w := httptest .NewRecorder ()
10481048 body , _ := json .Marshal (appView )
10491049 req , _ := http .NewRequest (http .MethodPost , "/v1/apps" , bytes .NewReader (body ))
@@ -1187,7 +1187,7 @@ func TestUpdateNativeNotFunctionApplication(t *testing.T) {
11871187 sApp .EXPECT ().Get (appView .Namespace , "abc" , "" ).Return (nil , common .Error (common .ErrResourceNotFound )).Times (1 )
11881188 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), nil ).Return (app12 , nil )
11891189 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
1190- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
1190+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
11911191 w = httptest .NewRecorder ()
11921192 body , _ = json .Marshal (appView12 )
11931193 req , _ = http .NewRequest (http .MethodPost , "/v1/apps" , bytes .NewReader (body ))
@@ -1310,7 +1310,7 @@ func TestUpdateNativeNotFunctionApplication(t *testing.T) {
13101310 sApp .EXPECT ().Get (appView .Namespace , "abc" , "" ).Return (app1 , nil ).Times (1 )
13111311 sApp .EXPECT ().Update (appView .Namespace , gomock .Any ()).Return (app2 , nil )
13121312 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
1313- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
1313+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
13141314
13151315 w = httptest .NewRecorder ()
13161316 body , _ = json .Marshal (appView2 )
@@ -1747,7 +1747,7 @@ func TestCreateFunctionApplication(t *testing.T) {
17471747 sConfig .EXPECT ().Upsert (appView .Namespace , gomock .Any ()).Return (config , nil ).Times (2 )
17481748 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), gomock .Any ()).Return (mApp , nil ).Times (1 )
17491749 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
1750- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
1750+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
17511751 sConfig .EXPECT ().Get (appView .Namespace , gomock .Any (), "" ).Return (config , nil ).AnyTimes ()
17521752
17531753 w = httptest .NewRecorder ()
@@ -2246,7 +2246,7 @@ func TestUpdateFunctionApplication(t *testing.T) {
22462246 sConfig .EXPECT ().Upsert (namespace , gomock .Any ()).Return (config4 , nil ).Times (1 )
22472247 sApp .EXPECT ().Update (namespace , gomock .Any ()).Return (newApp , nil ).Times (1 )
22482248 sNode .EXPECT ().UpdateNodeAppVersion (namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
2249- sIndex .EXPECT ().RefreshNodesIndexByApp (namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
2249+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
22502250 sConfig .EXPECT ().Delete (namespace , gomock .Any ()).Return (nil ).Times (3 )
22512251 sConfig .EXPECT ().Get (namespace , "baetyl-function-config-app-service-2" , "" ).Return (config2 , nil ).Times (1 )
22522252 sConfig .EXPECT ().Get (namespace , "baetyl-function-config-app-service-3" , "" ).Return (config2 , nil ).Times (1 )
@@ -2303,7 +2303,7 @@ func TestDeleteApplication(t *testing.T) {
23032303 // 200
23042304 sApp .EXPECT ().Get (gomock .Any (), "abc" , gomock .Any ()).Return (app , nil ).Times (1 )
23052305 sApp .EXPECT ().Delete (app .Namespace , app .Name , "" ).Return (nil ).Times (1 )
2306- sIndex .EXPECT ().RefreshNodesIndexByApp (app .Namespace , app .Name , gomock .Any ()).Return (nil ).Times (1 )
2306+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , app .Namespace , app .Name , gomock .Any ()).Return (nil ).Times (1 )
23072307 sNode .EXPECT ().DeleteNodeAppVersion (gomock .Any (), gomock .Any ()).Return (nil , nil ).Times (1 )
23082308 req , _ = http .NewRequest (http .MethodDelete , "/v1/apps/abc" , nil )
23092309 w = httptest .NewRecorder ()
@@ -2391,7 +2391,7 @@ func TestDeleteApplication(t *testing.T) {
23912391
23922392 // 200
23932393 sApp .EXPECT ().Get (gomock .Any (), "abc" , gomock .Any ()).Return (app , nil ).Times (1 )
2394- sIndex .EXPECT ().RefreshNodesIndexByApp (app .Namespace , app .Name , gomock .Any ()).Return (nil )
2394+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , app .Namespace , app .Name , gomock .Any ()).Return (nil )
23952395 sNode .EXPECT ().DeleteNodeAppVersion (gomock .Any (), gomock .Any ()).Return (nil , nil )
23962396 sApp .EXPECT ().Delete (app .Namespace , app .Name , "" ).Return (nil )
23972397 sConfig .EXPECT ().Delete (app .Namespace , "baetyl-function-config-app-service-xxxxxxxxx" ).Return (nil ).Times (1 )
@@ -2716,7 +2716,7 @@ func TestCreateKubeFunctionApplication(t *testing.T) {
27162716 sConfig .EXPECT ().Upsert (appView .Namespace , gomock .Any ()).Return (config , nil ).Times (2 )
27172717 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), gomock .Any ()).Return (mApp , nil ).Times (1 )
27182718 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
2719- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
2719+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
27202720 sConfig .EXPECT ().Get (appView .Namespace , gomock .Any (), "" ).Return (config , nil ).AnyTimes ()
27212721
27222722 w = httptest .NewRecorder ()
@@ -2833,7 +2833,7 @@ func TestCreateKubeNotFunctionApplication(t *testing.T) {
28332833 sApp .EXPECT ().Get (appView .Namespace , "eden2" , "" ).Return (eden2 , nil ).Return (eden2 , nil ).Times (1 )
28342834 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), eden2 ).Return (eden2 , nil )
28352835 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
2836- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
2836+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
28372837 sSecret .EXPECT ().Get (appView .Namespace , "secret01" , "" ).Return (secret , nil ).Times (1 )
28382838 w := httptest .NewRecorder ()
28392839 body , _ := json .Marshal (appView )
@@ -3152,7 +3152,7 @@ func TestCreateNativeFunctionApplication(t *testing.T) {
31523152 sConfig .EXPECT ().Upsert (appView .Namespace , gomock .Any ()).Return (config , nil ).Times (2 )
31533153 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), gomock .Any ()).Return (mApp , nil ).Times (1 )
31543154 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
3155- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
3155+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
31563156 sConfig .EXPECT ().Get (appView .Namespace , gomock .Any (), "" ).Return (config , nil ).AnyTimes ()
31573157
31583158 w = httptest .NewRecorder ()
@@ -3283,7 +3283,7 @@ func TestCreateNativeNotFunctionApplication(t *testing.T) {
32833283 sApp .EXPECT ().Get (appView .Namespace , "eden2" , "" ).Return (eden2 , nil ).Return (eden2 , nil ).Times (1 )
32843284 sApp .EXPECT ().CreateWithBase (appView .Namespace , gomock .Any (), eden2 ).Return (eden2 , nil )
32853285 sNode .EXPECT ().UpdateNodeAppVersion (appView .Namespace , gomock .Any ()).Return ([]string {}, nil ).Times (1 )
3286- sIndex .EXPECT ().RefreshNodesIndexByApp (appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
3286+ sIndex .EXPECT ().RefreshNodesIndexByApp (nil , appView .Namespace , gomock .Any (), gomock .Any ()).Return (nil ).Times (1 )
32873287 sSecret .EXPECT ().Get (appView .Namespace , "secret01" , "" ).Return (secret , nil ).Times (1 )
32883288 w := httptest .NewRecorder ()
32893289 body , _ := json .Marshal (appView )
0 commit comments