mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
license: do not parse expiry date if it does not exist (#19565)
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
863707edf8
commit
ac9ed89d6f
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