mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Add build_flavor
to /api/status
response (#176477)
## Summary Fix https://github.com/elastic/kibana/issues/176475 Add the `version.build_flavor` field to the response of the status API --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
479a022bd3
commit
1c3fa24be3
6 changed files with 9 additions and 2 deletions
|
@ -17,6 +17,7 @@ const buildServerVersion = (parts: Partial<ServerVersion> = {}): ServerVersion =
|
|||
build_number: 9000,
|
||||
build_snapshot: false,
|
||||
build_date: '2023-05-15T23:12:09.000Z',
|
||||
build_flavor: 'traditional',
|
||||
...parts,
|
||||
});
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ const mockedResponse: StatusResponse = {
|
|||
build_number: 12,
|
||||
build_snapshot: false,
|
||||
build_date: '2023-05-15T23:12:09.000Z',
|
||||
build_flavor: 'traditional',
|
||||
},
|
||||
status: {
|
||||
overall: {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { BuildFlavor } from '@kbn/config';
|
||||
import type { ServiceStatusLevelId, ServiceStatus, CoreStatus } from '@kbn/core-status-common';
|
||||
import type { OpsMetrics } from '@kbn/core-metrics-server';
|
||||
|
||||
|
@ -34,6 +35,7 @@ export interface ServerVersion {
|
|||
build_hash: string;
|
||||
build_number: number;
|
||||
build_snapshot: boolean;
|
||||
build_flavor: BuildFlavor;
|
||||
build_date: string;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
],
|
||||
"kbn_references": [
|
||||
"@kbn/core-status-common",
|
||||
"@kbn/core-metrics-server"
|
||||
"@kbn/core-metrics-server",
|
||||
"@kbn/config"
|
||||
],
|
||||
"exclude": [
|
||||
"target/**/*",
|
||||
|
|
|
@ -156,7 +156,7 @@ const getFullStatusResponse = async ({
|
|||
};
|
||||
query: { v8format?: boolean; v7format?: boolean };
|
||||
}): Promise<StatusHttpBody> => {
|
||||
const { version, buildSha, buildNum, buildDate } = config.packageInfo;
|
||||
const { version, buildSha, buildNum, buildDate, buildFlavor } = config.packageInfo;
|
||||
const versionWithoutSnapshot = version.replace(SNAPSHOT_POSTFIX, '');
|
||||
|
||||
let statusInfo: StatusInfo | LegacyStatusInfo;
|
||||
|
@ -186,6 +186,7 @@ const getFullStatusResponse = async ({
|
|||
build_hash: buildSha,
|
||||
build_number: buildNum,
|
||||
build_snapshot: SNAPSHOT_POSTFIX.test(version),
|
||||
build_flavor: buildFlavor,
|
||||
build_date: buildDate.toISOString(),
|
||||
},
|
||||
status: statusInfo,
|
||||
|
|
|
@ -210,6 +210,7 @@ describe('GET /api/status', () => {
|
|||
build_number: 1234,
|
||||
build_snapshot: true,
|
||||
build_date: new Date('2023-05-15T23:12:09.000Z').toISOString(),
|
||||
build_flavor: 'traditional',
|
||||
});
|
||||
const metricsMockValue = await firstValueFrom(metrics.getOpsMetrics$());
|
||||
expect(result.body.metrics).toEqual({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue