Skip to content
Draft
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
16 changes: 11 additions & 5 deletions internal/controller/eviction/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,13 +534,19 @@ func (r *EvictionReconciler) registerWithManager(mgr ctrl.Manager) error {

// SetupWithManager sets up the controller with the Manager.
func (r *EvictionReconciler) SetupWithManager(mgr ctrl.Manager) error {
ctx := context.Background()

var err error
if r.computeClient, err = openstack.GetServiceClient(ctx, "compute", nil); err != nil {
computeClient, err := openstack.GetServiceClient(context.Background(), "compute", nil)
if err != nil {
return err
}
r.computeClient.Microversion = "2.90" // Xena (or later)
computeClient.Microversion = "2.90" // Xena (or later)

return r.SetupWithManagerAndClient(mgr, computeClient)
}

// SetupWithManagerAndClient sets up the controller with the Manager and uses
// the given compute service client instead of discovering one from the
// environment.
func (r *EvictionReconciler) SetupWithManagerAndClient(mgr ctrl.Manager, computeClient *gophercloud.ServiceClient) error {
r.computeClient = computeClient
return r.registerWithManager(mgr)
}
Loading
Loading