Skip to content

Commit

Permalink
Merge pull request #1525 from alexcreasy/revert-cfbe4f
Browse files Browse the repository at this point in the history
Revert configurable thanos port
  • Loading branch information
openshift-merge-robot authored Jul 17, 2023
2 parents cfbe4f2 + fec931d commit a020b53
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions backend/src/routes/api/prometheus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { callPrometheusThanos } from '../../../utils/prometheusUtils';
import { createCustomError } from '../../../utils/requestUtils';
import { logRequestDetails } from '../../../utils/fileUtils';
import { THANOS_DEFAULT_OAUTH_PORT } from '../../../utils/constants';

const handleError = (e: createError.HttpError) => {
if (e?.code) {
Expand Down Expand Up @@ -57,7 +56,6 @@ module.exports = async (fastify: KubeFastifyInstance) => {
request,
query,
QueryType.QUERY_RANGE,
THANOS_DEFAULT_OAUTH_PORT,
).catch(handleError);
},
);
Expand Down
3 changes: 0 additions & 3 deletions backend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,3 @@ export const DEFAULT_NOTEBOOK_SIZES: NotebookSize[] = [

export const imageUrlRegex =
/^([\w.\-_]+((?::\d+|)(?=\/[a-z0-9._-]+\/[a-z0-9._-]+))|)(?:\/|)([a-z0-9.\-_]+(?:\/[a-z0-9.\-_]+|))(?::([\w.\-_]{1,127})|)/;

export const THANOS_DEFAULT_RBAC_PORT = '9092';
export const THANOS_DEFAULT_OAUTH_PORT = '9091';
5 changes: 2 additions & 3 deletions backend/src/utils/prometheusUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
PrometheusQueryRangeResponse,
QueryType,
} from '../types';
import { DEV_MODE, THANOS_DEFAULT_RBAC_PORT } from './constants';
import { DEV_MODE } from './constants';
import { getNamespaces } from './notebookUtils';
import { getDashboardConfig } from './resourceUtils';
import { createCustomError } from './requestUtils';
Expand Down Expand Up @@ -88,13 +88,12 @@ export const callPrometheusThanos = <T>(
request: OauthFastifyRequest,
query: string,
queryType: QueryType = QueryType.QUERY,
port = THANOS_DEFAULT_RBAC_PORT,
): Promise<{ code: number; response: T }> =>
callPrometheus<T>(
fastify,
request,
query,
generatePrometheusHostURL(fastify, 'thanos-querier', 'openshift-monitoring', port),
generatePrometheusHostURL(fastify, 'thanos-querier', 'openshift-monitoring', '9092'),
queryType,
);

Expand Down

0 comments on commit a020b53

Please sign in to comment.