Skip to content

[receiver/k8sobjectsreceiver] Properly deep copy the K8sObjectsConfig struct #39644

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

petern48
Copy link
Contributor

Description

In newReceiver() , we perform a shallow copy of the K8sObjectsConfig objects instead of a deep one.

Link to tracking issue

Fixes #39553

Testing

Added TestDeepCopy inside of config_test.go

@petern48
Copy link
Contributor Author

The original issue advised to refactor the config struct to separate mutable fields into a new struct. I tried that, but I felt it was much cleaner to simply keep it as is. I'm not sure if there was reasoning other than code readability, but I'm happy to change this if reviewers still want the refactor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/k8sobjectsreceiver] Refactor Config Struct to Separate Mutable Fields
2 participants