1
1
/* eslint-disable @typescript-eslint/no-explicit-any */
2
2
import {
3
+ k8sGet ,
3
4
K8sResourceCommon ,
4
5
MatchExpression ,
5
6
MatchLabels ,
6
7
Selector ,
7
- k8sGet ,
8
8
} from '@openshift-console/dynamic-plugin-sdk' ;
9
9
import _ from 'lodash' ;
10
10
import { RefObject , useEffect } from 'react' ;
@@ -16,7 +16,11 @@ import {
16
16
import { RouteModel , TektonResultModel } from '../../models' ;
17
17
import { PipelineRunKind , TaskRunKind } from '../../types' ;
18
18
import { K8sResourceKind } from '../../types/openshift' ;
19
- import { consoleProxyFetch , consoleProxyFetchJSON } from './proxy' ;
19
+ import {
20
+ consoleProxyFetch ,
21
+ consoleProxyFetchJSON ,
22
+ ProxyRequest ,
23
+ } from './proxy' ;
20
24
21
25
// REST API spec
22
26
// https://github.com/tektoncd/results/blob/main/docs/api/rest-api-spec.md
@@ -64,15 +68,6 @@ export type TektonResultsOptions = {
64
68
groupBy ?: string ;
65
69
} ;
66
70
67
- type ProxyRequest = {
68
- allowInsecure ?: boolean ;
69
- method : string ;
70
- url : string ;
71
- headers ?: Record < string , string [ ] > ;
72
- queryparams ?: Record < string , string [ ] > ;
73
- body ?: string ;
74
- } ;
75
-
76
71
const throw404 = ( ) => {
77
72
// eslint-disable-next-line no-throw-literal
78
73
throw { code : 404 } ;
@@ -335,6 +330,7 @@ export const getFilteredRecord = async <R extends K8sResourceCommon>(
335
330
url,
336
331
method : 'GET' ,
337
332
allowInsecure : true ,
333
+ allowAuthHeader : true ,
338
334
} ) ;
339
335
if ( options ?. limit >= 0 ) {
340
336
list = {
@@ -490,7 +486,12 @@ export const getTaskRunLog = async (taskRunPath: string): Promise<string> => {
490
486
'/records/' ,
491
487
'/logs/' ,
492
488
) } `;
493
- return consoleProxyFetchLog ( { url, method : 'GET' , allowInsecure : true } ) ;
489
+ return consoleProxyFetchLog ( {
490
+ url,
491
+ method : 'GET' ,
492
+ allowInsecure : true ,
493
+ allowAuthHeader : true ,
494
+ } ) ;
494
495
} ;
495
496
496
497
export const useLoadMoreOnScroll = (
0 commit comments