Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/v1.3.x] Fix incorrect use of format strings with the conditions package. #1199

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

fluxcdbot
Copy link
Member

Automated backport to release/v1.3.x, triggered by a label in #1198.

The `Mark…` functions in the `conditions` package accept a format string and
(optional) arguments, just like `fmt.Printf` and friends.

In many places, the code passed an error message as the format string, causing
it to be interpreted as a format string by the `fmt` package. This leads to
issues when the message contains percent signs, e.g. URL-encoded values.

This PR adds a format string and shortens `err.Error()` to `err`, which yields
the same output.

This change is identical in principle to
fluxcd/source-controller#1529.

Signed-off-by: Florian Forster <[email protected]>
(cherry picked from commit ad38b1c)
@stefanprodan stefanprodan merged commit 8818800 into release/v1.3.x Jul 8, 2024
2 checks passed
@stefanprodan stefanprodan deleted the backport-1198-to-release/v1.3.x branch July 8, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants