Skip to content

Commit

Permalink
Refactor all networking into networking package
Browse files Browse the repository at this point in the history
This refactors all networking client behavior into the networking
package. The network client has been removed from the compute Service
struct, instead, we use the networking Service. Ports and trunking logic
have been moved out of instance.go in the compute package into port.go
and trunk.go in the networking package.

The process for refactoring is simple enough:

1. Delete network client from compute package
2. Move any functions using the network client to the networking package
3. Refactor the functions to call the networking client interface
instead of gophercloud directly
  • Loading branch information
macaptain committed Sep 9, 2021
1 parent 1576e9c commit bd0e3cb
Show file tree
Hide file tree
Showing 8 changed files with 547 additions and 419 deletions.
2 changes: 1 addition & 1 deletion pkg/cloud/services/compute/bastion.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (s *Service) CreateBastion(openStackCluster *infrav1.OpenStackCluster, clus
RootVolume: openStackCluster.Spec.Bastion.Instance.RootVolume,
}

securityGroups, err := s.getSecurityGroups(openStackCluster.Spec.Bastion.Instance.SecurityGroups)
securityGroups, err := s.networkingService.GetSecurityGroups(openStackCluster.Spec.Bastion.Instance.SecurityGroups)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit bd0e3cb

Please sign in to comment.