Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

misc: make it work with gateway

Sheen Capadngan8cae92f29e93
diff --git a/backend/src/ee/services/dynamic-secret/providers/kubernetes.ts b/backend/src/ee/services/dynamic-secret/providers/kubernetes.ts
index 906779972c..1b6e275b71 100644
--- a/backend/src/ee/services/dynamic-secret/providers/kubernetes.ts
+++ b/backend/src/ee/services/dynamic-secret/providers/kubernetes.ts
@@ -80,10 +80,11 @@ export const KubernetesProvider = ({ gatewayService }: TKubernetesProviderDTO):
};
const url = new URL(providerInputs.url);
- const k8sHost = `${url.protocol}//${url.hostname}`;
const k8sPort = url.port ? Number(url.port) : 443;
if (providerInputs.gatewayId) {
+ const k8sHost = url.hostname;
+
await $gatewayProxyWrapper(
{
gatewayId: providerInputs.gatewayId,
@@ -93,6 +94,7 @@ export const KubernetesProvider = ({ gatewayService }: TKubernetesProviderDTO):
serviceAccountGetCallback
);
} else {
+ const k8sHost = `${url.protocol}//${url.hostname}`;
await serviceAccountGetCallback(k8sHost, k8sPort);
}
@@ -132,13 +134,14 @@ export const KubernetesProvider = ({ gatewayService }: TKubernetesProviderDTO):
const url = new URL(providerInputs.url);
const k8sHost = `${url.protocol}//${url.hostname}`;
+ const k8sGatewayHost = url.hostname;
const k8sPort = url.port ? Number(url.port) : 443;
const tokenData = providerInputs.gatewayId
? await $gatewayProxyWrapper(
{
gatewayId: providerInputs.gatewayId,
- targetHost: k8sHost,
+ targetHost: k8sGatewayHost,
targetPort: k8sPort
},
tokenRequestCallback