vatesfr / terraform-provider-xenorchestra

Xen Orchestra provider for Terraform
MIT License
150 stars 33 forks source link

Split Go client/SDK in a separate git repository? #173

Closed ringods closed 10 months ago

ringods commented 2 years ago

Hello @ddelnano,

The following folder in this repository contains a Golang implementation of the XenOrchestra API:

https://github.com/terra-farm/terraform-provider-xenorchestra/tree/master/client

Would you be open to splitting off this Go SDK for XenOrchestra in a separate Github repository? If so, I would propose to host it under https://github.com/vatesfr, for instance in a repo named go-xenorchestra. Looping in @olivierlambert for this.

I ask this for 2 reasons, the second being the main reason:

  1. Most Terraform providers do not have the SDK for the provider bundled with it. This would follow this pattern and make the setup "cleaner".
  2. I want to reuse the Go XenOrchestra SDK to bootstrap the Kubernetes Cloud Controller for XenOrchestra.

What do you think about this?

olivierlambert commented 2 years ago

I don't have a specific opinion about this, it's up to you guys :)

ddelnano commented 2 years ago

@ringods that sounds good to me. They are actually separate go modules already so the intention was to split it out at some point. There just wasn't a strong motivator for doing so, but I now that there will be another use case for the client (k8s cloud controller) it makes sense to do it now.

ringods commented 2 years ago

@olivierlambert can you create repository https://github.com/vatesfr/go-xenorchestra and provide me and @ddelnano access to it?

@ddelnano I will move the sources and send you a PR for the TF provider to use it.

olivierlambert commented 2 years ago

Sure, just let me check with @julien-f about the naming

olivierlambert commented 2 years ago

We probably need to name it in a way to understand what it is. Maybe go-xenorchestra seems to close to be understood as a reimplementation of XO in GO.

In our case, it's building a client for XO API. So why not something like xo-go-client or something like that? (to make it clear about what it is, ie a client for XO API in Go)

ringods commented 2 years ago

@olivierlambert I looked a bit around:

https://github.com/aws/aws-sdk-go https://github.com/googleapis/google-cloud-go https://github.com/Azure/azure-sdk-for-go

So I would let it end with -go, e.g. xo-sdk-go.

olivierlambert commented 2 years ago

Ah good idea to take a look around. We are OK for xo-sdk-go, creating the repo ASAP with permissions for both @ringods and @ddelnano

olivierlambert commented 2 years ago

Done and invites sent!

https://github.com/vatesfr/xo-sdk-go

ringods commented 2 years ago

@ddelnano I couldn't add you as a reviewer in the PR, but here is the SDK extracted in the new repo for you to see:

https://github.com/vatesfr/xo-sdk-go/pull/3

ddelnano commented 2 years ago

I missed accepting the invite but I should be able to be added as a reviewer now.