Skip to content

Commit

Permalink
specify _all as target in ClearCacheModal (opensearch-project#1020)
Browse files Browse the repository at this point in the history
When none of the indices are selected, ClearCacheModal makes call to
`//_cache/clear` path. Here, the intention is to clear the cache for
all indices, let's make it explicit by passing `_all` as target.

New call: `/_all/_cache/clear`

Signed-off-by: Rohit Ashiwal <[email protected]>
  • Loading branch information
r1walz authored Apr 9, 2024
1 parent 07c68ec commit 134f23f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/containers/ClearCacheModal/ClearCacheModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function ClearCacheModal(props: ClearCacheModalProps) {
const result = await services.commonService.apiCaller({
endpoint: "indices.clearCache",
data: {
index: unBlockedItems.join(","),
index: unBlockedItems.join(",") || "_all",
},
});
if (result && result.ok) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe("<IndicesActions /> spec", () => {
expect(browserServicesMock.commonService.apiCaller).toHaveBeenCalledWith({
endpoint: "indices.clearCache",
data: {
index: "",
index: "_all",
},
});
expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -238,7 +238,7 @@ describe("<IndicesActions /> spec", () => {
expect(browserServicesMock.commonService.apiCaller).toHaveBeenCalledWith({
endpoint: "indices.clearCache",
data: {
index: "",
index: "_all",
},
});
expect(coreServicesMock.notifications.toasts.addError).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit 134f23f

Please sign in to comment.