From 6af91172b7d06fc22e9d5a3cb570340d5ebc781c Mon Sep 17 00:00:00 2001 From: Vigneshraj Sekar Babu Date: Mon, 30 Mar 2026 18:59:07 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20escape=20inner=20double=20quot?= =?UTF-8?q?es=20in=20helm=20--set=20to=20preserve=20annotation=20=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 724f89f90e3d7f8cf96a22ca0797ffb9a9fc9c93. --- .../lib/nativeHelm/__tests__/helm.test.ts | 32 ------------------- src/server/lib/nativeHelm/utils.ts | 6 ++-- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/src/server/lib/nativeHelm/__tests__/helm.test.ts b/src/server/lib/nativeHelm/__tests__/helm.test.ts index 4f89f6a..eb069be 100644 --- a/src/server/lib/nativeHelm/__tests__/helm.test.ts +++ b/src/server/lib/nativeHelm/__tests__/helm.test.ts @@ -483,38 +483,6 @@ describe('Native Helm', () => { expect(result).not.toContain('--version'); }); - it('should preserve inner double quotes in --set keys for annotation paths', () => { - const result = constructHelmCommand( - 'upgrade --install', - 'my-chart', - 'my-release', - 'my-namespace', - ['ingress.extraAnnotations."app\\.kubernetes\\.io/name"=my-app'], - [], - ChartType.PUBLIC, - undefined, - 'https://example.com/charts' - ); - - expect(result).toContain('--set "ingress.extraAnnotations.\\"app\\.kubernetes\\.io/name\\"=my-app"'); - }); - - it('should escape inner double quotes in --set values', () => { - const result = constructHelmCommand( - 'upgrade --install', - 'my-chart', - 'my-release', - 'my-namespace', - ['deployment.env.MSG="hello world"'], - [], - ChartType.PUBLIC, - undefined, - 'https://example.com/charts' - ); - - expect(result).toContain('--set "deployment.env.MSG=\\"hello world\\""'); - }); - it('should not add chart version for PUBLIC charts when version is not specified', () => { const result = constructHelmCommand( 'upgrade --install', diff --git a/src/server/lib/nativeHelm/utils.ts b/src/server/lib/nativeHelm/utils.ts index d722c68..7ea2de1 100644 --- a/src/server/lib/nativeHelm/utils.ts +++ b/src/server/lib/nativeHelm/utils.ts @@ -93,12 +93,12 @@ export function constructHelmCommand( customValues.forEach((value) => { const equalIndex = value.indexOf('='); if (equalIndex > -1) { - const key = value.substring(0, equalIndex).replace(/"/g, '\\"'); + const key = value.substring(0, equalIndex); const val = value.substring(equalIndex + 1); - const escapedVal = escapeHelmValue(val).replace(/"/g, '\\"'); + const escapedVal = escapeHelmValue(val); command += ` --set "${key}=${escapedVal}"`; } else { - command += ` --set "${value.replace(/"/g, '\\"')}"`; + command += ` --set "${value}"`; } });