File tree Expand file tree Collapse file tree
frontend/packages/pipelines-plugin/src/components/pipelineruns/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -221,12 +221,20 @@ export const createTektonResultsUrl = async (
221221 options ?: TektonResultsOptions ,
222222 nextPageToken ?: string ,
223223) : Promise < string > => {
224- const tektonResultUrl = await getTRURLHost ( ) ;
225- if ( ! tektonResultUrl ) {
226- throw new Error ( 'route.spec.host is undefined' ) ;
224+ const tektonResult = await k8sGet ( TektonResultModel , 'result' ) ;
225+ const targetNamespace = tektonResult ?. spec ?. targetNamespace ;
226+ const serverPort = tektonResult ?. spec ?. server_port ?? '8080' ;
227+ const tlsHostname = tektonResult ?. spec ?. tls_hostname_override ;
228+ let tektonResultsAPI ;
229+ if ( tlsHostname ) {
230+ tektonResultsAPI = `${ tlsHostname } :${ serverPort } ` ;
231+ } else if ( targetNamespace && serverPort ) {
232+ tektonResultsAPI = `tekton-results-api-service.${ targetNamespace } .svc.cluster.local:${ serverPort } ` ;
233+ } else {
234+ tektonResultsAPI = `tekton-results-api-service.openshift-pipelines.svc.cluster.local:${ serverPort } ` ;
227235 }
228236 const namespaceToSearch = namespace && namespace !== ALL_NAMESPACES_KEY ? namespace : '-' ;
229- const url = `https://${ tektonResultUrl } /apis/results.tekton.dev/v1alpha2/parents/${ namespaceToSearch } /results/-/records?${ new URLSearchParams (
237+ const url = `https://${ tektonResultsAPI } /apis/results.tekton.dev/v1alpha2/parents/${ namespaceToSearch } /results/-/records?${ new URLSearchParams (
230238 {
231239 // default sort should always be by `create_time desc`
232240 // order_by: 'create_time desc', not supported yet
You can’t perform that action at this time.
0 commit comments