Skip to content

Commit 42f9b0a

Browse files
authored
Merge pull request #1508 from splunk/bugfix/CSPL-3705-configmap-apply-idxc
Bugfix/CSPL-3705 #1493 Update of IDXC configMap volumes does not apply properly
2 parents 4f03ca8 + 470d599 commit 42f9b0a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pkg/splunk/client/enterprise.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func (c *SplunkClient) Do(request *http.Request, expectedStatus []int, obj inter
7373
if err != nil {
7474
return err
7575
}
76+
7677
//default set flag to false and the check response code
7778
expectedStatusFlag := false
7879
for i := 0; i < len(expectedStatus); i++ {
@@ -81,8 +82,10 @@ func (c *SplunkClient) Do(request *http.Request, expectedStatus []int, obj inter
8182
break
8283
}
8384
}
85+
8486
if !expectedStatusFlag {
85-
return fmt.Errorf("response code=%d from %s; want %d", response.StatusCode, request.URL, expectedStatus)
87+
respBody, _ := io.ReadAll(response.Body)
88+
return fmt.Errorf("response code=%d from %s; want %d; err: %s", response.StatusCode, request.URL, expectedStatus, string(respBody))
8689
}
8790
if obj == nil {
8891
return nil
@@ -623,7 +626,11 @@ func (c *SplunkClient) DecommissionIndexerClusterPeer(enforceCounts bool) error
623626
return err
624627
}
625628
expectedStatus := []int{200}
626-
return c.Do(request, expectedStatus, nil)
629+
err = c.Do(request, expectedStatus, nil)
630+
if err != nil && strings.Contains(err.Error(), "decommission already requested") {
631+
err = nil
632+
}
633+
return err
627634
}
628635

629636
// BundlePush pushes the Cluster manager apps bundle to all the indexer peers

0 commit comments

Comments
 (0)