Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Conversation

jrperritt
Copy link
Contributor

No description provided.

@jrperritt jrperritt changed the title [wip] ip addresses (neutron extension) [rfr] ip addresses (neutron extension) Sep 16, 2015
@jrperritt jrperritt changed the title [rfr] ip addresses (neutron extension) [wip] ip addresses (neutron extension) Sep 16, 2015
@jrperritt jrperritt changed the title [wip] ip addresses (neutron extension) [rfr] ip addresses (neutron extension) Sep 17, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

we can't we embed os.Server here? (haven't worked in go in a while 😁 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but I don't think we gain anything here by doing it. Specifically, if the OpenStack server has fields that Rackspace doesn't have (now or in the future), we'll end up copy-and-pasting like this anyhow. Only if done that way, it would potentially break code that initializes a Rackspace server (since it'll no longer embed an OpenStack server):

server := rsServers.Server{
   osServers.Server{

   },
}

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I agree actually. I think we should decouple the providers as much as possible and not assume openstack is a superset

@jamiehannaford
Copy link
Contributor

I don't see anything wrong with copy and pasting the Rackspace Server struct into a more distinct thing. We'll likely be adding extra fields in the future, so it's probably best we decouple Rackspace's implementation.

The only question I have is whether all Rackspace API users will have this added field (my guess is yes). If this is not the case, the only other option would be to embed the os.Server into a new NetworkIPServer struct that lives in the ipaddresses subpkg or something, with its own extract fn. I'm not sure if this would even work, but you'd then be isolating this extension from any other.

Also, I know it's a pain, but do we have acceptance tests for this?

@jrperritt
Copy link
Contributor Author

Yeah, that field gets added to all of the responses from servers that respond with a server :/

Ah, quite right. All that copy-and-paste was to get that field I needed to create the acceptance tests in the first place (to share a public IP, the servers have to have the same value for that field.) I'll add those.

@jrperritt
Copy link
Contributor Author

Not ready to merge. Permissions issues (likely limited to me) arose while running the acceptance tests.

@jrperritt jrperritt changed the title [rfr] ip addresses (neutron extension) [wip] ip addresses (neutron extension) Sep 17, 2015
@jrperritt
Copy link
Contributor Author

Closing. This will go in the Rackspace extension to gophercloud/gophercloud

@jrperritt jrperritt closed this Jun 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants