UNPKG

@stolostron/multicluster-sdk

Version:

Provides extensions and APIs that dynamic plugins can use to leverage multicluster capabilities provided by Red Hat Advanced Cluster Management.

22 lines 817 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFleetK8sAPIPath = void 0; /* Copyright Contributors to the Open Cluster Management project */ const constants_1 = require("../internal/constants"); const isHubRequest_1 = require("../internal/isHubRequest"); /** * Function that provides the k8s API path for the fleet. * * @param cluster - The cluster name. * @returns The k8s API path for the fleet. */ const getFleetK8sAPIPath = async (cluster) => { if (await (0, isHubRequest_1.isHubRequest)(cluster)) { return constants_1.BASE_K8S_API_PATH; } else { return `${constants_1.BACKEND_URL}/${constants_1.MANAGED_CLUSTER_API_PATH}/${cluster}`; } }; exports.getFleetK8sAPIPath = getFleetK8sAPIPath; //# sourceMappingURL=getFleetK8sAPIPath.js.map