-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new ES client for licensing plugin #92143
Use new ES client for licensing plugin #92143
Conversation
This reverts commit 4a61b64
function normalizeServerLicense(license: RawLicense): PublicLicense { | ||
function normalizeServerLicense( | ||
license: estypes.XpackInfoMinimalLicenseInformation | ||
): PublicLicense { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client now provides proper typing for the xpack/info
endpoint, so we can now use them.
const normalizedLicense = | ||
response.license && response.license.type !== 'missing' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL there is a missing
type in the client def. Not sure this is really used, as it seems we never encountered it, but still added the check.
const cluster = instantiateClient( | ||
config.ui.elasticsearch, | ||
this.log, | ||
core.elasticsearch.createClient | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As monitoring is not migrated to the new client yet (due to this issue), I instantiated the new client at the only place we currently need it. I will let the owners refactor that when migrating the rest of the plugin
Pinging @elastic/kibana-core (Team:Core) |
@pgayvallet it looks like @simianhacker has the monitoring ui parts of this covered in #101850 Guessing it'd make sense for you to back yours out of this PR, but maybe best for you and him to work that out. |
Thanks for the info. Looking at #101850, it would be pretty straightforward to rebase my PR against it once it gets merged. I guess the best option is for me to wait until #101850 is merged and just remove the shim that @simianhacker was forced to use the your licensing service. Given that the PR is approved, I'm guessing it should be merged soon? |
path: '/_xpack?accept_enterprise=true', | ||
const { body: response } = await client.asInternalUser.xpack.info({ | ||
// @ts-expect-error `accept_enterprise` is not present in the client definition | ||
accept_enterprise: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while license.get
accepts accept_enterprise: true
, but it doesn't contain features
in the response object 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monitoring portion looks good to me.
💚 Build SucceededMetrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
* use new client for licensing API * add logs * adapt unit tests * Revert "add logs" This reverts commit 4a61b64 * fix some type errors * fix test types * adapt monitoring usage of `createLicensePoller` * remove test comment * fix unit test * remove createLicensePoller from setup contract * fix unit tests
Merging after FF to complete #101850 |
* use new client for licensing API * add logs * adapt unit tests * Revert "add logs" This reverts commit 4a61b64 * fix some type errors * fix test types * adapt monitoring usage of `createLicensePoller` * remove test comment * fix unit test * remove createLicensePoller from setup contract * fix unit tests
* use new client for licensing API * add logs * adapt unit tests * Revert "add logs" This reverts commit 4a61b64 * fix some type errors * fix test types * adapt monitoring usage of `createLicensePoller` * remove test comment * fix unit test * remove createLicensePoller from setup contract * fix unit tests
* use new client for licensing API * add logs * adapt unit tests * Revert "add logs" This reverts commit 4a61b64 * fix some type errors * fix test types * adapt monitoring usage of `createLicensePoller` * remove test comment * fix unit test * remove createLicensePoller from setup contract * fix unit tests Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
Summary
Part of #83910
Fix #92185
licensing
plugin to use the new ES clientmonitoring
usage ofcreateLicensePoller
Checklist