Skip to content

Commit

Permalink
Merge pull request #208 from gthiemonge/scopes
Browse files Browse the repository at this point in the history
Fix Scope client and dep on NeutronAPI
  • Loading branch information
openshift-merge-bot[bot] authored Dec 7, 2023
2 parents baf276f + f49ad88 commit cdbdd42
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
2 changes: 0 additions & 2 deletions controllers/amphoracontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (

keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
oko_secret "github.com/openstack-k8s-operators/lib-common/modules/common/secret"
neutronv1 "github.com/openstack-k8s-operators/neutron-operator/api/v1beta1"
octaviav1 "github.com/openstack-k8s-operators/octavia-operator/api/v1beta1"
"github.com/openstack-k8s-operators/octavia-operator/pkg/amphoracontrollers"
appsv1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -486,6 +485,5 @@ func (r *OctaviaAmphoraControllerReconciler) SetupWithManager(mgr ctrl.Manager)
Owns(&corev1.Secret{}).
Owns(&corev1.ConfigMap{}).
Owns(&appsv1.Deployment{}).
Owns(&neutronv1.NeutronAPI{}).
Complete(r)
}
2 changes: 1 addition & 1 deletion pkg/amphoracontrollers/flavors.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func EnsureFlavors(ctx context.Context, instance *octaviav1.OctaviaAmphoraContro
if err != nil {
return "", err
}
osclient, _, err := octavia.GetAdminServiceClient(ctx, helper, keystoneAPI, octavia.ClientOpts{})
osclient, _, err := octavia.GetAdminServiceClient(ctx, helper, keystoneAPI)
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/amphoracontrollers/lb_mgmt_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func EnsureLbMgmtNetworks(ctx context.Context, instance *octaviav1.OctaviaAmphor
if err != nil {
return "", err
}
o, _, err := octavia.GetAdminServiceClient(ctx, helper, keystoneAPI, octavia.ClientOpts{SystemScope: true})
o, _, err := octavia.GetAdminServiceClient(ctx, helper, keystoneAPI)
if err != nil {
return "", err
}
Expand Down
12 changes: 0 additions & 12 deletions pkg/octavia/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,11 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
)

// ClientOpts - enable features in the OpenStack client
type ClientOpts struct {
// SystemScope indicates that the client uses system scope instead of project scope
SystemScope bool
}

// GetAdminServiceClient -
func GetAdminServiceClient(
ctx context.Context,
h *helper.Helper,
keystoneAPI *keystonev1.KeystoneAPI,
clientOpts ClientOpts,
) (*openstack.OpenStack, ctrl.Result, error) {
// get internal endpoint as authurl from keystone instance
authURL, err := keystoneAPI.GetEndpoint(endpoint.EndpointInternal)
Expand Down Expand Up @@ -72,11 +65,6 @@ func GetAdminServiceClient(
DomainName: "Default",
Region: keystoneAPI.Spec.Region,
}
if clientOpts.SystemScope {
authOpts.Scope = &gophercloud.AuthScope{
System: clientOpts.SystemScope,
}
}

os, err := openstack.NewOpenStack(
h.GetLogger(),
Expand Down

0 comments on commit cdbdd42

Please sign in to comment.