mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Basic licenses never expire, so they do not have an expiration date at all according to the Elasticsearch API. When this happens, we should not attempt to parse the date nor show the expiry date in the log.
This commit is contained in:
parent
b0e3e1fdf0
commit
607d58615c
1 changed files with 10 additions and 4 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { createHash } from 'crypto';
|
||||
import moment from 'moment';
|
||||
import { get } from 'lodash';
|
||||
import { get, has } from 'lodash';
|
||||
import { Poller } from '../../../../common/poller';
|
||||
import { XPackInfoLicense } from './xpack_info_license';
|
||||
|
||||
|
@ -117,11 +117,17 @@ export class XPackInfo {
|
|||
});
|
||||
|
||||
if (this._hasLicenseInfoChanged(response)) {
|
||||
const licenseInfo = [
|
||||
const licenseInfoParts = [
|
||||
`mode: ${get(response, 'license.mode')}`,
|
||||
`status: ${get(response, 'license.status')}`,
|
||||
`expiry date: ${moment(get(response, 'license.expiry_date_in_millis'), 'x').format()}`
|
||||
].join(' | ');
|
||||
];
|
||||
|
||||
if (has(response, 'license.expiry_date_in_millis')) {
|
||||
const expiryDate = moment(response.license.expiry_date_in_millis, 'x').format();
|
||||
licenseInfoParts.push(`expiry date: ${expiryDate}`);
|
||||
}
|
||||
|
||||
const licenseInfo = licenseInfoParts.join(' | ');
|
||||
|
||||
this._log(
|
||||
['license', 'info', 'xpack'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue