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

Make logger optional in Stash client #209

Closed
Tracked by #3808
makkes opened this issue Apr 19, 2023 · 0 comments · Fixed by #210
Closed
Tracked by #3808

Make logger optional in Stash client #209

makkes opened this issue Apr 19, 2023 · 0 comments · Fixed by #210
Assignees

Comments

@makkes
Copy link
Member

makkes commented Apr 19, 2023

In this discussion it was reported that the Flux CLI fails to bootstrap a Bitbucket Server/Stash repository. The reason is that no logger is passed to the client but a logger is required for the client to work. This, in conjunction with this change in logr led to the bug experienced in the Flux CLI.

It should be up to the consumer of the GGP API whether to pass in a logger or not so it should be made truly optional.

related to fluxcd/flux2#3808

@makkes makkes self-assigned this Apr 19, 2023
makkes pushed a commit that referenced this issue Apr 19, 2023
In version 1.2.4 a [change](go-logr/logr#166)
was introduced that significantly changed the assumptions about logr's
API, i.e. that `logr.Logger{} != logr.Discard()`. This condition
doesn't evaluate to true with 1.2.4, anymore, and the default value of
the `logr.Logger` type is now usable as a replacement for
`logr.Discard()`.

Therefore we do not need to check if the value has been provided,
anymore: If it is not provided, the default one is used which is
effectively a discarding logger.

closes #209

Signed-off-by: Max Jonas Werner <mail@makk.es>
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 a pull request may close this issue.

1 participant