Skip to content

Commit

Permalink
fix: return decoded urls on CloudStart as well as CloudSetup (#161711)
Browse files Browse the repository at this point in the history
## Summary

#159442 updated the decoding of the cloud id and added
`elasticsearchUrl` & `kibanaUrl` to the `CloudStart` type, but it only
set them on the `CloudSetup` result.

This change will also add them to the `CloudStart` so they are available
to code that is trying to read the values from `CloudStart` , mainly
[serverless_search](https://github.com/elastic/kibana/blob/main/x-pack/plugins/serverless_search/public/application/components/overview.tsx#L49-L51)
is what I'm concerned with.
  • Loading branch information
TattdCodeMonkey committed Jul 12, 2023
1 parent 62c9a1f commit c4790da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x-pack/plugins/cloud/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export class CloudPlugin implements Plugin<CloudSetup> {

const { deploymentUrl, profileUrl, billingUrl, organizationUrl } = this.getCloudUrls();

let decodedId: DecodedCloudId | undefined;
if (this.config.id) {
decodedId = decodeCloudId(this.config.id, this.logger);
}

return {
CloudContextProvider,
isCloudEnabled: this.isCloudEnabled,
Expand All @@ -111,6 +116,8 @@ export class CloudPlugin implements Plugin<CloudSetup> {
deploymentUrl,
profileUrl,
organizationUrl,
elasticsearchUrl: decodedId?.elasticsearchUrl,
kibanaUrl: decodedId?.kibanaUrl,
};
}

Expand Down

0 comments on commit c4790da

Please sign in to comment.