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

fix(inputs.opcua): Assign node id correctly #11723

Merged
merged 2 commits into from
Aug 31, 2022
Merged

fix(inputs.opcua): Assign node id correctly #11723

merged 2 commits into from
Aug 31, 2022

Conversation

sspaink
Copy link
Contributor

@sspaink sspaink commented Aug 25, 2022

resolve: #11719

The ID was being set to the local copy of "node" in the loop, in order for the to be saved so it can be used later in the code: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/opcua/opcua.go#L516 it needs to be assigned using the index so that the original value gets updated. More context of this behavior: https://stackoverflow.com/questions/61605727/why-does-normal-for-loop-allows-assigning-value-to-struct-fields-while-for-range

@telegraf-tiger telegraf-tiger bot added area/opcua fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Aug 25, 2022
@sspaink sspaink mentioned this pull request Aug 25, 2022
@telegraf-tiger
Copy link
Contributor

@sspaink sspaink added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Aug 31, 2022
@sspaink sspaink merged commit 15c7bc5 into master Aug 31, 2022
@sspaink sspaink deleted the fixidassign branch August 31, 2022 21:56
dba-leshop pushed a commit to dba-leshop/telegraf that referenced this pull request Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/opcua fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

id is blank?
2 participants