mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
misc: make it work with gateway
This commit is contained in:
@@ -80,10 +80,11 @@ export const KubernetesProvider = ({ gatewayService }: TKubernetesProviderDTO):
|
|||||||
};
|
};
|
||||||
|
|
||||||
const url = new URL(providerInputs.url);
|
const url = new URL(providerInputs.url);
|
||||||
const k8sHost = `${url.protocol}//${url.hostname}`;
|
|
||||||
const k8sPort = url.port ? Number(url.port) : 443;
|
const k8sPort = url.port ? Number(url.port) : 443;
|
||||||
|
|
||||||
if (providerInputs.gatewayId) {
|
if (providerInputs.gatewayId) {
|
||||||
|
const k8sHost = url.hostname;
|
||||||
|
|
||||||
await $gatewayProxyWrapper(
|
await $gatewayProxyWrapper(
|
||||||
{
|
{
|
||||||
gatewayId: providerInputs.gatewayId,
|
gatewayId: providerInputs.gatewayId,
|
||||||
@@ -93,6 +94,7 @@ export const KubernetesProvider = ({ gatewayService }: TKubernetesProviderDTO):
|
|||||||
serviceAccountGetCallback
|
serviceAccountGetCallback
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
const k8sHost = `${url.protocol}//${url.hostname}`;
|
||||||
await serviceAccountGetCallback(k8sHost, k8sPort);
|
await serviceAccountGetCallback(k8sHost, k8sPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,13 +134,14 @@ export const KubernetesProvider = ({ gatewayService }: TKubernetesProviderDTO):
|
|||||||
|
|
||||||
const url = new URL(providerInputs.url);
|
const url = new URL(providerInputs.url);
|
||||||
const k8sHost = `${url.protocol}//${url.hostname}`;
|
const k8sHost = `${url.protocol}//${url.hostname}`;
|
||||||
|
const k8sGatewayHost = url.hostname;
|
||||||
const k8sPort = url.port ? Number(url.port) : 443;
|
const k8sPort = url.port ? Number(url.port) : 443;
|
||||||
|
|
||||||
const tokenData = providerInputs.gatewayId
|
const tokenData = providerInputs.gatewayId
|
||||||
? await $gatewayProxyWrapper(
|
? await $gatewayProxyWrapper(
|
||||||
{
|
{
|
||||||
gatewayId: providerInputs.gatewayId,
|
gatewayId: providerInputs.gatewayId,
|
||||||
targetHost: k8sHost,
|
targetHost: k8sGatewayHost,
|
||||||
targetPort: k8sPort
|
targetPort: k8sPort
|
||||||
},
|
},
|
||||||
tokenRequestCallback
|
tokenRequestCallback
|
||||||
|
|||||||
Reference in New Issue
Block a user