Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛Fix missing endpoint type in OpenStack endpoint clients configuration #1744

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/clients/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ type computeClient struct{ client *gophercloud.ServiceClient }
// NewComputeClient returns a new compute client.
func NewComputeClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (ComputeClient, error) {
compute, err := openstack.NewComputeV2(providerClient, gophercloud.EndpointOpts{
Region: providerClientOpts.RegionName,
Region: providerClientOpts.RegionName,
Availability: clientconfig.GetEndpointType(providerClientOpts.EndpointType),
})
if err != nil {
return nil, fmt.Errorf("failed to create compute service client: %v", err)
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ type imageClient struct{ client *gophercloud.ServiceClient }
// NewImageClient returns a new glance client.
func NewImageClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (ImageClient, error) {
images, err := openstack.NewImageServiceV2(providerClient, gophercloud.EndpointOpts{
Region: providerClientOpts.RegionName,
Region: providerClientOpts.RegionName,
Availability: clientconfig.GetEndpointType(providerClientOpts.EndpointType),
})
if err != nil {
return nil, fmt.Errorf("failed to create image service client: %v", err)
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ type lbClient struct {
// NewLbClient returns a new loadbalancer client.
func NewLbClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (LbClient, error) {
loadbalancerClient, err := openstack.NewLoadBalancerV2(providerClient, gophercloud.EndpointOpts{
Region: providerClientOpts.RegionName,
Region: providerClientOpts.RegionName,
Availability: clientconfig.GetEndpointType(providerClientOpts.EndpointType),
})
if err != nil {
return nil, fmt.Errorf("failed to create load balancer service client: %v", err)
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ type networkClient struct {
// NewNetworkClient returns an instance of the networking service.
func NewNetworkClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (NetworkClient, error) {
serviceClient, err := openstack.NewNetworkV2(providerClient, gophercloud.EndpointOpts{
Region: providerClientOpts.RegionName,
Region: providerClientOpts.RegionName,
Availability: clientconfig.GetEndpointType(providerClientOpts.EndpointType),
})
if err != nil {
return nil, fmt.Errorf("failed to create networking service providerClient: %v", err)
Expand Down
3 changes: 2 additions & 1 deletion pkg/clients/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ type volumeClient struct{ client *gophercloud.ServiceClient }
// NewVolumeClient returns a new cinder client.
func NewVolumeClient(providerClient *gophercloud.ProviderClient, providerClientOpts *clientconfig.ClientOpts) (VolumeClient, error) {
volume, err := openstack.NewBlockStorageV3(providerClient, gophercloud.EndpointOpts{
Region: providerClientOpts.RegionName,
Region: providerClientOpts.RegionName,
Availability: clientconfig.GetEndpointType(providerClientOpts.EndpointType),
})
if err != nil {
return nil, fmt.Errorf("failed to create volume service client: %v", err)
Expand Down
1 change: 1 addition & 0 deletions pkg/scope/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func NewProviderClient(cloud clientconfig.Cloud, caCert []byte, logger logr.Logg
clientOpts.AuthInfo = cloud.AuthInfo
clientOpts.AuthType = cloud.AuthType
clientOpts.RegionName = cloud.RegionName
clientOpts.EndpointType = cloud.EndpointType
}

opts, err := clientconfig.AuthOptions(clientOpts)
Expand Down