Skip to content

Commit

Permalink
[Fleet] Fix property renamed spaceId -> spaceIds (elastic#190826)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Aug 20, 2024
1 parent cf43ba2 commit 789675a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/fleet/server/services/package_policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()
);
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/fleet/server/services/package_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
Expand Down Expand Up @@ -1688,7 +1688,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient {
): Promise<UpgradePackagePolicyDryRunResponseItem> {
const updatedPackagePolicy = updatePackageInputs(
{
...omit(packagePolicy, 'id', 'spaceId'),
...omit(packagePolicy, 'id', 'spaceIds'),
inputs: packagePolicy.inputs,
package: {
...packagePolicy.package!,
Expand Down Expand Up @@ -1944,7 +1944,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient {
const omitted = {
...omit(result, [
'id',
'spaceId',
'spaceIds',
'version',
'revision',
'updated_at',
Expand Down

0 comments on commit 789675a

Please sign in to comment.