Skip to content

Commit

Permalink
Merge pull request #140 from cschwede/create-rbac-roles
Browse files Browse the repository at this point in the history
Create Keystone roles for Swift RBAC
  • Loading branch information
cschwede authored Feb 21, 2024
2 parents a7018fa + 7ab172b commit 5e615b8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions controllers/swiftproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,20 @@ func (r *SwiftProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request)
return ctrlResult, err
}

// Create OpenStack roles for Swift RBAC
os, _, err := keystonev1.GetAdminServiceClient(ctx, helper, keystoneAPI)
if err != nil {
return ctrl.Result{}, err
}
_, err = os.CreateRole(r.Log, "SwiftProjectReader")
if err != nil {
return ctrl.Result{}, err
}
_, err = os.CreateRole(r.Log, "SwiftSystemReader")
if err != nil {
return ctrl.Result{}, err
}

// Get the service password
sps, hash, err := secret.GetSecret(ctx, helper, instance.Spec.Secret, instance.Namespace)
if err != nil {
Expand Down

0 comments on commit 5e615b8

Please sign in to comment.