OpenSearch-Dashboards icon indicating copy to clipboard operation
OpenSearch-Dashboards copied to clipboard

[Discussion] Why is LocalCluster's id ''?

Open derek-ho opened this issue 1 year ago • 0 comments

This issue is to discuss why for the multiple datasources feature the local cluster's id is ''. When implementing multiple datasources support for the security plugin, we realized that it is easy to confuse an empty string, with not passing in a variable. From a plugin developer perspective, it would be less confusing and error prone to have a different constant for the local cluster id, for example LOCAL or something equivalent. That way, when changing all the API calls to be multiple datasource compatible the caller needs to explicitly pass in LOCAL instead of if they forgot it defaults to the local cluster silently. Maybe there is some reason that I am not aware of why this decision was made.

From what I have seen, created datasource ids follow the format similar to '35c87960-00eb-11ef-98de-c373b609f89d', so anything not matching this format should work for the id of the local cluster, right?

derek-ho avatar Apr 25 '24 15:04 derek-ho