Remove eager Setup() call from ClientWithConfig.UnmarshalYAML#304
Conversation
Setup() was called with no options during YAML unmarshaling, which caused it to no-op when Connect(ctx, opts...) was later called with options such as a logger or retry policy. Deferring setup to Connect (or an explicit Setup call) ensures those options are applied. Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
This PR adjusts YAML unmarshaling for ClientWithConfig so it no longer eagerly initializes the underlying Client, ensuring Connect(ctx, opts...) options (e.g., logger/retry) are actually applied when the client is set up.
Changes:
- Remove the eager
Setup()call fromClientWithConfig.UnmarshalYAML. - Update the
UnmarshalYAMLdoc comment to describe the new “defer setup to Connect/Setup” behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Setup() was called with no options during YAML unmarshaling, which caused it to no-op when Connect(ctx, opts...) was later called with options such as a logger or retry policy. Deferring setup to Connect (or an explicit Setup call) ensures those options are applied.