Skip to content

Commit

Permalink
Revert "Merge pull request #1503 from alexcreasy/configurable-thanos-…
Browse files Browse the repository at this point in the history
…port"

This reverts commit cfbe4f2, reversing
changes made to 0683de3.
  • Loading branch information
alexcreasy committed Jul 17, 2023
1 parent cfbe4f2 commit fec931d
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 fec931d

Please sign in to comment.