Skip to content

Commit cbb10eb

Browse files
committed
CSPL-3705 Ignoring an error if decommisioning already enabled
1 parent f547e60 commit cbb10eb

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.github/workflows/int-test-azure-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- develop
66
- main
7+
- bugfix/CSPL-3705-configmap-apply-idxc
78
jobs:
89
build-operator-image:
910
runs-on: ubuntu-latest

.github/workflows/int-test-gcp-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- develop
77
- main
8+
- bugfix/CSPL-3705-configmap-apply-idxc
89
jobs:
910
build-operator-image:
1011
runs-on: ubuntu-latest

.github/workflows/int-test-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
- develop
66
- main
77
- feature**
8+
- bugfix/CSPL-3705-configmap-apply-idxc
89
jobs:
910
build-operator-image:
1011
runs-on: ubuntu-latest

pkg/splunk/client/enterprise.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ func (c *SplunkClient) Do(request *http.Request, expectedStatus []int, obj inter
8282
break
8383
}
8484
}
85+
8586
if !expectedStatusFlag {
86-
return fmt.Errorf("response code=%d from %s; want %d; full response %v, response body: %v", response.StatusCode, request.URL, expectedStatus, response, response.Body)
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))
8789
}
8890
if obj == nil {
8991
return nil
@@ -624,7 +626,11 @@ func (c *SplunkClient) DecommissionIndexerClusterPeer(enforceCounts bool) error
624626
return err
625627
}
626628
expectedStatus := []int{200}
627-
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
628634
}
629635

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

0 commit comments

Comments
 (0)