-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[8.0] remove kibana.index
config property
#112773
Changes from all commits
8b51e51
dc8f78b
c766a2b
5791071
954217f
19c916d
d2af27d
dfddcc8
43eb4fc
d4e6ef7
c2409c1
6dc9a7d
0632b83
bedf656
bb48eb0
9920a84
d72fe95
566f266
057d9e4
fecb83b
c6470cd
7efd28c
723312d
235aa73
a098cd2
f068d13
c46ae22
4d443c4
627ea46
3fdb550
1c01ac6
2888c5e
df11842
7e95da3
72ed91a
277a3ad
f2c38d4
ee793e6
f112393
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) > [getKibanaIndex](./kibana-plugin-core-server.savedobjectsservicesetup.getkibanaindex.md) | ||
|
||
## SavedObjectsServiceSetup.getKibanaIndex property | ||
|
||
Returns the default index used for saved objects. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getKibanaIndex: () => string; | ||
``` |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,26 +13,22 @@ import { pick, deepFreeze } from '@kbn/std'; | |
import { IConfigService } from '@kbn/config'; | ||
|
||
import { SharedGlobalConfig, SharedGlobalConfigKeys } from './types'; | ||
import { KibanaConfigType, config as kibanaConfig } from '../kibana_config'; | ||
import { | ||
ElasticsearchConfigType, | ||
config as elasticsearchConfig, | ||
} from '../elasticsearch/elasticsearch_config'; | ||
import { SavedObjectsConfigType, savedObjectsConfig } from '../saved_objects/saved_objects_config'; | ||
|
||
const createGlobalConfig = ({ | ||
kibana, | ||
elasticsearch, | ||
path, | ||
savedObjects, | ||
}: { | ||
kibana: KibanaConfigType; | ||
elasticsearch: ElasticsearchConfigType; | ||
path: PathConfigType; | ||
savedObjects: SavedObjectsConfigType; | ||
}): SharedGlobalConfig => { | ||
return deepFreeze({ | ||
kibana: pick(kibana, SharedGlobalConfigKeys.kibana), | ||
elasticsearch: pick(elasticsearch, SharedGlobalConfigKeys.elasticsearch), | ||
path: pick(path, SharedGlobalConfigKeys.path), | ||
savedObjects: pick(savedObjects, SharedGlobalConfigKeys.savedObjects), | ||
|
@@ -41,7 +37,6 @@ const createGlobalConfig = ({ | |
|
||
export const getGlobalConfig = (configService: IConfigService): SharedGlobalConfig => { | ||
return createGlobalConfig({ | ||
kibana: configService.atPathSync<KibanaConfigType>(kibanaConfig.path), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like we can remove other props from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't remove the legacy config completely without additional changes. I know at least There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 not in the current PR, for sure |
||
elasticsearch: configService.atPathSync<ElasticsearchConfigType>(elasticsearchConfig.path), | ||
path: configService.atPathSync<PathConfigType>(pathConfig.path), | ||
savedObjects: configService.atPathSync<SavedObjectsConfigType>(savedObjectsConfig.path), | ||
|
@@ -50,15 +45,13 @@ export const getGlobalConfig = (configService: IConfigService): SharedGlobalConf | |
|
||
export const getGlobalConfig$ = (configService: IConfigService): Observable<SharedGlobalConfig> => { | ||
return combineLatest([ | ||
configService.atPath<KibanaConfigType>(kibanaConfig.path), | ||
configService.atPath<ElasticsearchConfigType>(elasticsearchConfig.path), | ||
configService.atPath<PathConfigType>(pathConfig.path), | ||
configService.atPath<SavedObjectsConfigType>(savedObjectsConfig.path), | ||
]).pipe( | ||
map( | ||
([kibana, elasticsearch, path, savedObjects]) => | ||
([elasticsearch, path, savedObjects]) => | ||
createGlobalConfig({ | ||
kibana, | ||
elasticsearch, | ||
path, | ||
savedObjects, | ||
|
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
savedObjects
service depends oncoreUsageData
, and not the other way around, so we can't easily use the newgetKibanaIndex
API from within thecoreUsageData
service. Had to hardcode the value here, unfortunately.Could eventually expose this constant from
src/core/saved_objects
and import it there, it would probably be slightly better, but OTOH this will likely not change, and this code is only internal to core, so it would be not impact API consumers if we need to refactor it in the future.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.
So we have a circular dependency here?
savedObjects.setup
depends onInternalCoreUsageDataSetup
coreUsageData.start
depends onInternalSavedObjectsServiceStart
We will have to fix it eventually.
Since
coreUsageData.start
has access toInternalSavedObjectsServiceStart
we can exposegetKibanaIndex
via start contract as well