Skip to content

Commit

Permalink
feat: add workspaces as empty array in config client
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Mar 22, 2024
1 parent 62c0b58 commit b5694be
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ export async function createOrUpgradeSavedConfig(

try {
// create the new SavedConfig
await savedObjectsClient.create('config', attributes, { id: version });
await savedObjectsClient.create('config', attributes, {
id: version,
// config is a global object that should not belong to any of the workspaces
// declare it as empty array to prevent it being created as a workspace object
workspaces: [],
});
} catch (error) {
if (handleWriteErrors) {
if (SavedObjectsErrorHelpers.isConflictError(error)) {
Expand Down

0 comments on commit b5694be

Please sign in to comment.