Skip to content

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

fix: replace nested ternary with if/else

bernie-ge6b29e27565e
diff --git a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.ts b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.ts
index 73e902cfa5..4ffa4cadce 100644
--- a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.ts
+++ b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-service.ts
@@ -1147,11 +1147,14 @@ export const identityKubernetesAuthServiceFactory = ({
const effectiveKubernetesHost =
kubernetesHost !== undefined ? kubernetesHost : identityKubernetesAuth.kubernetesHost;
const effectiveGatewayPoolId = gatewayPoolId !== undefined ? gatewayPoolId : identityKubernetesAuth.gatewayPoolId;
- const effectiveGatewayId = effectiveGatewayPoolId
- ? null
- : gatewayId !== undefined
- ? gatewayId
- : (identityKubernetesAuth.gatewayV2Id ?? identityKubernetesAuth.gatewayId);
+ let effectiveGatewayId: string | null | undefined = null;
+ if (effectiveGatewayPoolId) {
+ effectiveGatewayId = null;
+ } else if (gatewayId !== undefined) {
+ effectiveGatewayId = gatewayId;
+ } else {
+ effectiveGatewayId = identityKubernetesAuth.gatewayV2Id ?? identityKubernetesAuth.gatewayId;
+ }
const { encryptor, decryptor } = await kmsService.createCipherPairWithDataKey({
type: KmsDataKey.Organization,