diff --git a/x-pack/plugins/fleet/server/services/package_policy.test.ts b/x-pack/plugins/fleet/server/services/package_policy.test.ts index 08a2ef507fe20f..fa86c4b0b9e2d8 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.test.ts @@ -5269,14 +5269,14 @@ describe('getUpgradeDryRunDiff', () => { ]); }); - it('should omit spaceId when upgrading package policies with spaceId', async () => { + it('should omit spaceIds when upgrading package policies with spaceIds', async () => { savedObjectsClient.get.mockImplementation((type, id) => Promise.resolve({ id, type: 'abcd', references: [], version: '0.9.0', - attributes: { ...createPackagePolicyMock(), name: id, spaceId: 'test' }, + attributes: { ...createPackagePolicyMock(), name: id, spaceIds: ['test'] }, }) ); const elasticsearchClient = elasticsearchServiceMock.createClusterClient().asInternalUser; @@ -5296,7 +5296,7 @@ describe('getUpgradeDryRunDiff', () => { 'ingest-package-policies', 'package-policy-id-test-spaceId', expect.not.objectContaining({ - spaceId: expect.anything(), + spaceIds: expect.anything(), }), expect.anything() ); diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index d64c48ba7143b1..a53334c893fecb 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -1603,7 +1603,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { ) { const updatePackagePolicy = updatePackageInputs( { - ...omit(packagePolicy, 'id', 'spaceId'), + ...omit(packagePolicy, 'id', 'spaceIds'), inputs: packagePolicy.inputs, package: { ...packagePolicy.package!, @@ -1688,7 +1688,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { ): Promise { const updatedPackagePolicy = updatePackageInputs( { - ...omit(packagePolicy, 'id', 'spaceId'), + ...omit(packagePolicy, 'id', 'spaceIds'), inputs: packagePolicy.inputs, package: { ...packagePolicy.package!, @@ -1944,7 +1944,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { const omitted = { ...omit(result, [ 'id', - 'spaceId', + 'spaceIds', 'version', 'revision', 'updated_at',