From a803ee48729bced0b06ac91ea3e09cf8f8916eb4 Mon Sep 17 00:00:00 2001 From: IldarMinaev Date: Wed, 22 Jan 2025 19:31:57 +0400 Subject: [PATCH] Fix nginxCloneScriptTemplate for old shells dash version 0.5.10.2-5 return error for export command with spaces after = symbol: ``` # export qwe=nginx version: nginx/1.20.1 dash: 10: export: version:: bad variable name ``` --- pkg/instrumentation/nginx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/instrumentation/nginx.go b/pkg/instrumentation/nginx.go index 7bcc39d611..581ccc929e 100644 --- a/pkg/instrumentation/nginx.go +++ b/pkg/instrumentation/nginx.go @@ -96,7 +96,7 @@ func injectNginxSDK(_ logr.Logger, nginxSpec v1alpha1.Nginx, pod corev1.Pod, use nginxCloneScriptTemplate := ` cp -r %[2]s/* %[3]s && -export %[4]s=$( { nginx -v ; } 2>&1 ) && echo ${%[4]s##*/} > %[3]s/version.txt +export %[4]s="$( { nginx -v ; } 2>&1 )" && echo ${%[4]s##*/} > %[3]s/version.txt ` nginxAgentCommands := prepareCommandFromTemplate(nginxCloneScriptTemplate, nginxConfFile,