@@ -317,7 +317,7 @@ func TestSearchHeadClusterPodManager(t *testing.T) {
317317 },
318318 }
319319 method = "searchHeadClusterPodManager.Update(All pods ready)"
320- wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [5 ]}, "Create" : {funcCalls [1 ]}, "List" : {listmockCall [0 ]}}
320+ wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [0 ], funcCalls [ 5 ]}, "Create" : {funcCalls [1 ]}, "List" : {listmockCall [0 ]}}
321321 searchHeadClusterPodManagerTester (t , method , mockHandlers , 1 , enterpriseApi .PhaseReady , statefulSet , wantCalls , nil , statefulSet , pod )
322322
323323 // test pod needs update => transition to detention
@@ -337,21 +337,21 @@ func TestSearchHeadClusterPodManager(t *testing.T) {
337337 )
338338 pod .ObjectMeta .Labels ["controller-revision-hash" ] = "v0"
339339 method = "searchHeadClusterPodManager.Update(Quarantine Pod)"
340- wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [5 ], funcCalls [2 ], funcCalls [2 ]}, "Create" : {funcCalls [1 ]}}
340+ wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [0 ], funcCalls [ 5 ], funcCalls [2 ], funcCalls [2 ]}, "Create" : {funcCalls [1 ]}}
341341 searchHeadClusterPodManagerTester (t , method , mockHandlers , 1 , enterpriseApi .PhaseUpdating , statefulSet , wantCalls , nil , statefulSet , pod )
342342
343343 // test pod needs update => wait for searches to drain
344344 mockHandlers = []spltest.MockHTTPHandler {mockHandlers [0 ], mockHandlers [1 ]}
345345 mockHandlers [0 ].Body = strings .Replace (mockHandlers [0 ].Body , `"status":"Up"` , `"status":"ManualDetention"` , 1 )
346346 mockHandlers [0 ].Body = strings .Replace (mockHandlers [0 ].Body , `"active_historical_search_count":0` , `"active_historical_search_count":1` , 1 )
347347 method = "searchHeadClusterPodManager.Update(Draining Searches)"
348- wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [5 ]}, "Create" : {funcCalls [1 ]}}
348+ wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [0 ], funcCalls [ 5 ]}, "Create" : {funcCalls [1 ]}}
349349 searchHeadClusterPodManagerTester (t , method , mockHandlers , 1 , enterpriseApi .PhaseUpdating , statefulSet , wantCalls , nil , statefulSet , pod )
350350
351351 // test pod needs update => delete pod
352352 mockHandlers [0 ].Body = strings .Replace (mockHandlers [0 ].Body , `"active_historical_search_count":1` , `"active_historical_search_count":0` , 1 )
353353 method = "searchHeadClusterPodManager.Update(Delete Pod)"
354- wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [5 ]}, "Create" : {funcCalls [1 ]}, "Delete" : {funcCalls [5 ]}}
354+ wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [0 ], funcCalls [ 5 ]}, "Create" : {funcCalls [1 ]}, "Delete" : {funcCalls [5 ]}}
355355 searchHeadClusterPodManagerTester (t , method , mockHandlers , 1 , enterpriseApi .PhaseUpdating , statefulSet , wantCalls , nil , statefulSet , pod )
356356
357357 // test pod update finished => release from detention
@@ -364,7 +364,7 @@ func TestSearchHeadClusterPodManager(t *testing.T) {
364364 Body : `` ,
365365 })
366366 method = "searchHeadClusterPodManager.Update(Release Quarantine)"
367- wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [5 ], funcCalls [2 ]}, "Create" : {funcCalls [1 ]}}
367+ wantCalls = map [string ][]spltest.MockFuncCall {"Get" : {funcCalls [0 ], funcCalls [1 ], funcCalls [1 ], funcCalls [2 ], funcCalls [2 ], funcCalls [0 ], funcCalls [ 5 ], funcCalls [2 ]}, "Create" : {funcCalls [1 ]}}
368368 searchHeadClusterPodManagerTester (t , method , mockHandlers , 1 , enterpriseApi .PhaseUpdating , statefulSet , wantCalls , nil , statefulSet , pod )
369369
370370 // test scale down => remove member
@@ -394,6 +394,7 @@ func TestSearchHeadClusterPodManager(t *testing.T) {
394394 {MetaName : "*v1.Pod-test-splunk-stack1-search-head-0" },
395395 {MetaName : "*v1.Pod-test-splunk-stack1-search-head-0" },
396396 {MetaName : "*v1.Pod-test-splunk-stack1-search-head-1" },
397+ {MetaName : "*v1.StatefulSet-test-splunk-stack1" },
397398 {MetaName : "*v1.Pod-test-splunk-stack1-search-head-1" },
398399 {MetaName : "*v1.PersistentVolumeClaim-test-pvc-etc-splunk-stack1-1" },
399400 {MetaName : "*v1.PersistentVolumeClaim-test-pvc-var-splunk-stack1-1" },
0 commit comments