Skip to content

Commit

Permalink
Ignore not found errors when deleting data streams (#1953)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoriano authored Jul 4, 2024
1 parent 23aaa90 commit f749723
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/testrunner/runners/system/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,15 @@ func (r *tester) deleteDataStream(ctx context.Context, dataStream string) error
r.esAPI.Indices.DeleteDataStream.WithContext(ctx),
)
if err != nil {
return fmt.Errorf("failed to delete data stream %s: %w", dataStream, err)
return fmt.Errorf("delete request failed for data stream %s: %w", dataStream, err)
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusNotFound {
// Data stream doesn't exist, there was nothing to do.
return nil
}
if resp.IsError() {
return fmt.Errorf("could not get delete data stream %s: %s", dataStream, resp.String())
return fmt.Errorf("delete request failed for data stream %s: %s", dataStream, resp.String())
}
return nil
}
Expand Down

0 comments on commit f749723

Please sign in to comment.