Skip to content

Commit

Permalink
fix(proxy-injector): handle proxy-log-level with quotes (#13480)
Browse files Browse the repository at this point in the history
The proxy accepts log filters in the form `target[fields...]=level`, where a
field may include a value match. This leads to log filters like
`linkerd[name="outbound"]=debug`.

When a log filter is configured via annotation or Helm, the proxy-injector fails
to properly quote the log environment variable, leading to a failure to patch
resources properly.

To fix this, this change ensures that the log level is quoted, which properly
escapes any quotes in the filter itself.
  • Loading branch information
olix0r authored Dec 13, 2024
1 parent 71d15ff commit f5b82f2
Show file tree
Hide file tree
Showing 4 changed files with 448 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/partials/templates/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ env:
- name: LINKERD2_PROXY_SHUTDOWN_ENDPOINT_ENABLED
value: {{.Values.proxy.enableShutdownEndpoint | quote}}
- name: LINKERD2_PROXY_LOG
value: "{{.Values.proxy.logLevel}}{{ if not (eq .Values.proxy.logHTTPHeaders "insecure") }},[{headers}]=off,[{request}]=off{{ end }}"
value: {{ printf "%s%s" .Values.proxy.logLevel (.Values.proxy.logHTTPHeaders | eq "insecure" | ternary "" ",[{headers}]=off,[{request}]=off") | quote }}
- name: LINKERD2_PROXY_LOG_FORMAT
value: {{.Values.proxy.logFormat | quote}}
- name: LINKERD2_PROXY_DESTINATION_SVC_ADDR
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f5b82f2

Please sign in to comment.