File tree Expand file tree Collapse file tree
Sources/DataTransferObjects/Query Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -230,11 +230,17 @@ extension CustomQuery {
230230 }
231231
232232 // Decide the data source based on the data source property and namespaces
233- if let dataSource = query. dataSource, allowedDataSourceNames. contains ( dataSource. name) {
234- query. dataSource = . init( dataSource. name)
235- } else if let namespace, ( namespaceAvailableAfter ?? Date . distantPast) < earliestIntervalDate {
233+ if let namespace, ( namespaceAvailableAfter ?? Date . distantPast) < earliestIntervalDate {
234+ // If a namespace is available, use the namespace, even if another data source is specified.
235+ // This allows us to specify com.telemetrydeck.all for global queries and still use the customer's
236+ // name space if they have one.
236237 query. dataSource = . init( namespace)
238+ } else if let dataSource = query. dataSource, allowedDataSourceNames. contains ( dataSource. name) {
239+ // If no namespace is available and the customer requested a specific data source, use it
240+ // if it is in the list of allowed data sources.
241+ query. dataSource = . init( dataSource. name)
237242 } else {
243+ // Else fall back to telemetry-signals
238244 query. dataSource = . init( " telemetry-signals " )
239245 }
240246 }
You can’t perform that action at this time.
0 commit comments