-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
chore: remove config Validate call in docker #34699
chore: remove config Validate call in docker #34699
Conversation
Skip changelog? |
if config.Endpoint == "" { | ||
return errors.New("config.Endpoint must be specified") | ||
} | ||
if err := VersionIsValidAndGTE(config.DockerAPIVersion, minimumRequiredDockerAPIVersion); err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already being validated by each components Validate
:
func (config Config) Validate() error { |
cc @mx-psi |
3d6a7e9
to
6dfd875
Compare
return err | ||
} | ||
return nil | ||
|
||
if len(config.ExcludedImages) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not certain this is strictly needed, zero and empty lists are effectively the same when iterating over them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I added this check to keep the PR nop. The component's configuration test expect a nil list but the inner Unmarshal is now returning an empty one. If prefered, I can readapt the test to assert an empty list.
@rogercoll can you fix CI? we can merge after that |
@mx-psi Fixed 👍 Thanks for the heads up |
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Configuration validation is done during collector's startup, making it redundant when being called inside component's logic. This PR removes the Validate call done during Dockers's receiver start function. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#33498 **Testing:** <Describe what testing was performed and which tests were added.> No testing needed to be modified as the `Validate` functionality is already covered. **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Description:
Configuration validation is done during collector's startup, making it redundant when being called inside component's logic. This PR removes the Validate call done during Dockers's receiver start function.
Link to tracking Issue:
#33498
Testing:
No testing needed to be modified as the
Validate
functionality is already covered.Documentation: