Skip to content

Refactor provider Get method

Steve Xuereb requested to merge refactor-get-vm-gcp into master

Change Get method for Provider interface

The Provider.Get method was asking for a pointer to a VirtualMachine configuration, which allowed implementations to mutate the struct without the caller knowing, which can lead to data races and unexpected behavior.

There is only 1 implementation of the Provider interface right now and it only needed the VM name to get all the details about the VM. Update the interface to reflect this. If there are future providers that would require more information then just a name we would refactor at that point when we context on what is needed.

Refactor getVM for gcp provider

The getVM only needed the name to get the VM from the API, update the API of getVM to just take the name to make the API even smaller.

Edited by Steve Xuereb

Merge request reports

Loading