Commit bbc5c68
committed
OCPBUGS-27965: 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 '%'. However, during
proxy validation, the Installer parses the URI and fails when it
encounters a "%%" with an `invalid URL escape` error.
To mitigate the problem, we introduce a new `replace` function to the
templating system and use it to substitute "%" with "%%" causing the
following config:
```
proxy:
httpProxy: http://user%40test:[email protected]:3128
httpsProxy: http://user%40test:[email protected]:3128
```
to become the `10-default-env.conf`:
```
[Manager]
DefaultEnvironment=HTTP_PROXY="http://user%%40test:[email protected]:3128"
DefaultEnvironment=HTTPS_PROXY="http://user%%40test:[email protected]:3128"
```
[1] https://man7.org/linux/man-pages/man5/systemd-system.conf.5.html1 parent 514c886 commit bbc5c68
File tree
2 files changed
+9
-4
lines changed- data/data/bootstrap/files/etc/systemd/system.conf.d
- pkg/asset/ignition/bootstrap
2 files changed
+9
-4
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
521 | 526 | | |
522 | 527 | | |
523 | 528 | | |
| |||
529 | 534 | | |
530 | 535 | | |
531 | 536 | | |
532 | | - | |
| 537 | + | |
533 | 538 | | |
534 | 539 | | |
535 | 540 | | |
| |||
0 commit comments