Closed dsonck92 closed 3 years ago
Obviously, that vanity url can also point to github.com/open-iscsi/targetd-go/ if embedded alongside targetd is not a requirement
No strong preference where the golang client library resides, whatever works best for you.
If we construct the library and API correctly it should always work, it just might not have all the functionality that is currently available in the targetd service, so I'm not concerned with them being in lock step.
Agreed, then I propose to keep it a separate repository. When I've incorporated the chown feature inside the provisioner and refactored it to extract the client part, it can be forked under open-iscsi
FYI: I implemented Go library for targetd!
@whywaita interesting, I will take a look at it and try to utilize it with the targetd-provisioner and see if it covers all the requirements. One thing I would like to point out is that your library currently doesn't seem to parse error codes.
During testing of my provisioner with my own code, one problem I found was that sometimes I need to delete exports that were already deleted. Obviously, this is an error, as something that does not exist, cannot be removed. However, in the case of the provisioner, I consider the "export not found" during delete a non-error, and return success. So I had to look at this and came up with this:
So probably you want to create a higher level error format. But, that's not for this issue so I might open an issue for it on your repo.
@dsonck92 okay, please open an issue in my repo if you found a problem 🙏
It might be useful to create a go library to wrap the functionality of targetd. I'm already working on the mentioned targetd provisioner so once this has enough functionality, I can extract the interface to a separate library which could be adopted.
It does then become a question of whether we want to ship the library inside this repository, ensuring that it will always stay matched with targetd. There are possibilities to create a vanity url that essentially rewrites the package to something else to match the expectations of the user. E.g. "go.open-iscsi.com/targetd" which then points to some subdirectory of this, say
github.com/open-iscsi/targetd/go/