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): return an error with mismatched types #11539

Merged
merged 4 commits into from
Jul 27, 2022

Conversation

MyaLongmire
Copy link
Contributor

@MyaLongmire MyaLongmire commented Jul 21, 2022

Required for all PRs

  • make check
  • make check-deps
  • make test
  • make docs

resolves #9164

opcua is panicking if the identifier_type does not match the actual type of identifier. This pr checks the type for strings and ints. I could not come up with a way to check guid or opaque types. And added a unit test

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jul 21, 2022
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MyaLongmire, thanks for this fix! I've just one question regarding the string type...

plugins/inputs/opcua/opcua.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Jul 22, 2022
@srebhan srebhan added area/opcua plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jul 22, 2022
@telegraf-tiger
Copy link
Contributor

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the fix @MyaLongmire!

@srebhan srebhan 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 Jul 27, 2022
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@MyaLongmire MyaLongmire merged commit 13b0ed0 into master Jul 27, 2022
@MyaLongmire MyaLongmire deleted the opcua-identifier-type branch July 27, 2022 19:14
reimda pushed a commit that referenced this pull request Aug 15, 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.

Telegraf OPCUA runtime error: invalid memory address or nil pointer dereference
3 participants