-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add opcua mapper #4
Conversation
@fisherxu @luogangyi |
|
||
COPY ./opcua kubeedge/ | ||
COPY ./config.yaml kubeedge/ | ||
COPY ./ca /ca |
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.
It could be better if provide a tool to generate certs.
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.
Thanks for your comment. The cert is a demo. It depends on the external opcua server.
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 think we should provide a tool to generate them although it is a demo.
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.
We can remove it from dockerfile/image, and mount into contaier if needed
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.
The customer could package it without any file or with the files for them own. It depends on the authentication method the opcua server requires. This folder is an example that the customer could refer to.
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.
Thanks for the new Mapper, and please remove the binary :)
Makefile
Outdated
sudo docker build -t opcuamapper:v1.0 ./pkg/opcua | ||
|
||
clean: | ||
rm -f ./pkg/modbus/modbus ./pkg/opcua/modbus |
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.
rm -f ./pkg/modbus/modbus ./pkg/opcua/modbus | |
rm -f ./pkg/modbus/modbus ./pkg/opcua/opcua |
?
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.
Done.
|
||
COPY ./opcua kubeedge/ | ||
COPY ./config.yaml kubeedge/ | ||
COPY ./ca /ca |
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.
We can remove it from dockerfile/image, and mount into contaier if needed
@@ -0,0 +1 @@ | |||
testpass |
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.
?
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.
It's the password file. The original design is that: define the username & password in the device instance yaml and pass it by the configmap. I think it's dangerous and change to use the password file which is in local directory.
pkg/opcua/driver/client_test.go
Outdated
Certfile: "/home/wei/ca/clientcert.pem", | ||
Keyfile: "/home/wei/ca/clientkey.pem", | ||
RemoteCertfile: "/home/wei/ca/servercert.pem", | ||
*/ |
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.
We can remove it if unnecessary
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.
Sorry, I'll refine the test. There're several test cases in one test function.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fisherxu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@sailorvii Let's fix any issues in follow-up PRs. |
The issue is at kubeedge/kubeedge#2461.
This mapper uses open source code github.com/gopcua/opcua as the driver.
The code framework refers to the modbus mapper.
It has been tested with simulated opcua server & device: https://python-opcua.readthedocs.io/en/latest/.