Skip to content

Commit

Permalink
Fix issue when bootstrapping on 2.x (#7901)
Browse files Browse the repository at this point in the history
* Fix issue bootstrapping dynamic config service

Signed-off-by: Huy Nguyen <[email protected]>

* Changeset file for PR #7901 created/updated

---------

Signed-off-by: Huy Nguyen <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
huyaboo and opensearch-changeset-bot[bot] authored Aug 29, 2024
1 parent a857941 commit 07504f6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7901.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix bootstrap errors in 2.x ([#7901](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7901))
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('OpenSearchConfigStoreClient', () => {
hits: mockHits.map((hit) => ({
_index: getDynamicConfigIndexName(1),
_id: JSON.stringify(hit),
_version: 1,
_source: hit,
})),
},
Expand Down Expand Up @@ -299,6 +300,11 @@ describe('OpenSearchConfigStoreClient', () => {
{
create: {
_id: itemId,
_index: DYNAMIC_APP_CONFIG_ALIAS,
retry_on_conflict: 2,
routing: '',
version: 1,
version_type: 'external',
},
},
{
Expand All @@ -314,6 +320,11 @@ describe('OpenSearchConfigStoreClient', () => {
{
update: {
_id: JSON.stringify(configDocument),
_index: DYNAMIC_APP_CONFIG_ALIAS,
retry_on_conflict: 2,
routing: '',
version: 2,
version_type: 'external',
},
},
{
Expand Down Expand Up @@ -483,6 +494,11 @@ describe('OpenSearchConfigStoreClient', () => {
{
update: {
_id: JSON.stringify(oldConfig),
_index: DYNAMIC_APP_CONFIG_ALIAS,
retry_on_conflict: 2,
routing: '',
version: 2,
version_type: 'external',
},
},
{
Expand All @@ -503,6 +519,11 @@ describe('OpenSearchConfigStoreClient', () => {
{
create: {
_id: JSON.stringify(config),
_index: DYNAMIC_APP_CONFIG_ALIAS,
retry_on_conflict: 2,
routing: '',
version: 1,
version_type: 'external',
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ export class OpenSearchConfigStoreClient implements IDynamicConfigStoreClient {
{
update: {
_id: config._id,
_index: DYNAMIC_APP_CONFIG_ALIAS,
retry_on_conflict: 2,
routing: '',
version: config._version! + 1,
version_type: 'external',
},
},
{
Expand Down Expand Up @@ -267,6 +272,11 @@ export class OpenSearchConfigStoreClient implements IDynamicConfigStoreClient {
{
create: {
_id: uniqueId(),
_index: DYNAMIC_APP_CONFIG_ALIAS,
retry_on_conflict: 2,
routing: '',
version: 1,
version_type: 'external',
},
},
newConfigDocument
Expand Down

0 comments on commit 07504f6

Please sign in to comment.