Skip to content

Commit c2bd15f

Browse files
committed
OCPBUGS-33024: agent: escape '%' in proxy settings
The 'DefaultEnvironment' config from systemd accepts some % specifiers for expansion [1]. Because of that, proxy configurations that make use of that character need to be escaped with another '%'. [1] https://man7.org/linux/man-pages/man5/systemd-system.conf.5.html
1 parent 59cc24d commit c2bd15f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{{if .Proxy -}}
22
[Manager]
33
{{if .Proxy.HTTPProxy -}}
4-
DefaultEnvironment=HTTP_PROXY="{{.Proxy.HTTPProxy}}"
4+
DefaultEnvironment=HTTP_PROXY="{{replace .Proxy.HTTPProxy "%" "%%"}}"
55
{{end -}}
66
{{if .Proxy.HTTPSProxy -}}
7-
DefaultEnvironment=HTTPS_PROXY="{{.Proxy.HTTPSProxy}}"
7+
DefaultEnvironment=HTTPS_PROXY="{{replace .Proxy.HTTPSProxy "%" "%%"}}"
88
{{end -}}
99
{{if .Proxy.NoProxy -}}
1010
DefaultEnvironment=NO_PROXY="{{.Proxy.NoProxy}}"
1111
{{end -}}
12-
{{end -}}
12+
{{end -}}

0 commit comments

Comments
 (0)