Skip to content

Commit

Permalink
Merge branch '7.17' into ua/deprecation_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 28, 2022
2 parents 54eccf4 + b8bf1ba commit fae7214
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 17 deletions.
30 changes: 30 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Review important information about the {kib} 7.17.x releases.
// Best practices:
// * When there are changes to kibana.yml settings, include the links to the new settings.

* <<release-notes-7.17.1>>
* <<release-notes-7.17.0>>
//* <<release-notes-7.16.3>>
//* <<release-notes-7.16.2>>
Expand Down Expand Up @@ -71,6 +72,35 @@ Review important information about the {kib} 7.17.x releases.

--

[[release-notes-7.17.1]]
== {kib} 7.17.1

coming::[7.17.1]

The 7.17.1 release includes the following bug fixes.

[float]
[[fixes-v7.17.1]]
=== Bug fixes
Elastic Security::
For the Elastic Security 7.17.1 release information, refer to {security-guide}/release-notes.html[_Elastic Security Solution Release Notes_].
Lens & Visualizations::
* Removes tabify performance issue {kibana-pull}124931[#124931]
* Fixes an issue where shard failures were not reported in *TSVB* {kibana-pull}123474[#123474]
Machine Learning::
* Fixes anomaly detector jobs list filter delay {kibana-pull}124328[#124328]
Management::
* You can now use the search bar in the snapshots list of the Snapshot & Restore app with date strings {kibana-pull}125234[#125234]
* Adds warning when remote clusters are configured {kibana-pull}125138[#125138]
* Updates logic for handling reindex failures {kibana-pull}124571[#124571]
* Fixes redirect to the wizard {kibana-pull}124337[#124337]
* Fixes cross cluster search when using the `fields` search request parameter for versions of {es} prior to 7.0 {kibana-pull}123267[#123267]
Maps::
Fixes an issue where layers from WMS capabilities for a specific URL were unable to load {kibana-pull}123386[#123386]
Security::
* Prevents repeated calls to extend session when Kibana is unavailable {kibana-pull}125973[#125973]
* Changed deprecation warning for elasticsearch.username {kibana-pull}124717[#124717]

[[release-notes-7.17.0]]
== {kib} 7.17.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await esArchiver.loadIfNeeded(
'test/functional/fixtures/es_archiver/index_pattern_without_timefield'
);
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/index_pattern_without_timefield'
);
await kibanaServer.uiSettings.replace({
defaultIndex: 'without-timefield',
'timepicker:timeDefaults': '{ "from": "2019-01-18T19:37:13.000Z", "to": "now"}',
Expand All @@ -37,6 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await esArchiver.unload(
'test/functional/fixtures/es_archiver/index_pattern_without_timefield'
);
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
});

it('should not display a timepicker', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
{
"type": "doc",
"value": {
"id": "index-pattern:without-timefield",
"index": ".kibana",
"source": {
"index-pattern": {
"fields": "[]",
"title": "without-timefield"
},
"type": "index-pattern"
}
}
}

{
"type": "doc",
"value": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"attributes": {
"fields": "[]",
"timeFieldName": "@timestamp",
"title": "with-timefield"
},
"coreMigrationVersion": "7.17.1",
"id": "with-timefield",
"migrationVersion": {
"index-pattern": "7.11.0"
},
"references": [],
"type": "index-pattern",
"version": "WzEzLDJd"
}

{
"attributes": {
"fields": "[]",
"title": "without-timefield"
},
"coreMigrationVersion": "7.17.1",
"id": "without-timefield",
"migrationVersion": {
"index-pattern": "7.11.0"
},
"references": [],
"type": "index-pattern",
"version": "WzEyLDJd"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Path from 'path';
import * as kbnTestServer from 'src/core/test_helpers/kbn_server';

import type { AgentPolicySOAttributes } from '../types';
import { PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE } from '../../common';

import { useDockerRegistry } from './docker_registry_helper';

Expand Down Expand Up @@ -288,5 +289,39 @@ describe.skip('Fleet preconfiguration rest', () => {
])
);
});

it('Works and reset one preconfigured policies if the policy was deleted with a preconfiguration deletion record', async () => {
const soClient = kbnServer.coreStart.savedObjects.createInternalRepository();

await soClient.delete('ingest-agent-policies', POLICY_ID);
await soClient.create(PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, {
id: POLICY_ID,
});

const resetAPI = kbnTestServer.getSupertest(
kbnServer.root,
'post',
`/internal/fleet/reset_preconfigured_agent_policies/${POLICY_ID}`
);
await resetAPI.set('kbn-sxrf', 'xx').expect(200).send();

const agentPolicies = await kbnServer.coreStart.savedObjects
.createInternalRepository()
.find<AgentPolicySOAttributes>({
type: 'ingest-agent-policies',
perPage: 10000,
});
expect(agentPolicies.saved_objects).toHaveLength(2);
expect(agentPolicies.saved_objects.map((ap) => ({ ...ap.attributes }))).toEqual(
expect.arrayContaining([
expect.objectContaining({
name: 'Elastic Cloud agent policy 0001',
}),
expect.objectContaining({
name: 'Second preconfigured policy',
}),
])
);
});
});
});
5 changes: 3 additions & 2 deletions x-pack/plugins/fleet/server/services/package_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,10 @@ class PackagePolicyService {
}
// Check that the name does not exist already but exclude the current package policy
const existingPoliciesWithName = await this.list(soClient, {
perPage: 1,
kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name: "${packagePolicy.name}"`,
perPage: SO_SEARCH_LIMIT,
kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name:"${packagePolicy.name}"`,
});

const filtered = (existingPoliciesWithName?.items || []).filter((p) => p.id !== id);

if (filtered.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
AGENT_POLICY_SAVED_OBJECT_TYPE,
SO_SEARCH_LIMIT,
PACKAGE_POLICY_SAVED_OBJECT_TYPE,
PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE,
} from '../../constants';
import { agentPolicyService } from '../agent_policy';
import { packagePolicyService } from '../package_policy';
Expand All @@ -30,6 +31,7 @@ export async function resetPreconfiguredAgentPolicies(
logger.warn('Reseting Fleet preconfigured agent policies');
await _deleteExistingData(soClient, esClient, logger, agentPolicyId);
await _deleteGhostPackagePolicies(soClient, esClient, logger);
await _deletePreconfigurationDeleteRecord(soClient, logger, agentPolicyId);

await setupFleet(soClient, esClient);
}
Expand Down Expand Up @@ -78,6 +80,40 @@ async function _deleteGhostPackagePolicies(
);
}

async function _deletePreconfigurationDeleteRecord(
soClient: SavedObjectsClientContract,
logger: Logger,
agentPolicyId?: string
) {
const existingDeletionRecord = await soClient.find<{ id: string }>({
type: PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE,
perPage: SO_SEARCH_LIMIT,
});

const deletionRecordSavedObjects = agentPolicyId
? existingDeletionRecord.saved_objects.filter((so) => so.attributes.id === agentPolicyId)
: existingDeletionRecord.saved_objects;

if (deletionRecordSavedObjects.length > 0) {
await pMap(
deletionRecordSavedObjects,
(savedObject) =>
soClient
.delete(PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, savedObject.id)
.catch((err) => {
if (soClient.errors.isNotFoundError(err)) {
return undefined;
}
throw err;
}),

{
concurrency: 20,
}
);
}
}

async function _deleteExistingData(
soClient: SavedObjectsClientContract,
esClient: ElasticsearchClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default function ({ getService }) {
})
.expect(200);

// Work around ESTF failure outlined in https://github.com/elastic/kibana/issues/124594
indexDetailFixture.logs = body.logs;

expect(body).to.eql(indexDetailFixture);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const queryBar = getService('queryBar');
const PageObjects = getPageObjects(['common', 'settings', 'context', 'header']);

Expand All @@ -17,12 +18,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await esArchiver.loadIfNeeded(
'test/functional/fixtures/es_archiver/index_pattern_without_timefield'
);
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/index_pattern_without_timefield'
);
await kibanaServer.uiSettings.replace({ defaultIndex: 'without-timefield' });
await kibanaServer.uiSettings.update({
'doc_table:legacy': true,
});
});

after(async () => {
await esArchiver.unload(
'test/functional/fixtures/es_archiver/index_pattern_without_timefield'
);
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.uiSettings.unset('defaultIndex');
await kibanaServer.uiSettings.unset('doc_table:legacy');
});

it('shows all autosuggest options for a filter in discover context app', async () => {
Expand Down

0 comments on commit fae7214

Please sign in to comment.