Skip to content

Commit

Permalink
Merge pull request #905 from bshephar/rbac-serviceaccounts
Browse files Browse the repository at this point in the history
Add RBAC for serviceaccounts
  • Loading branch information
openshift-merge-bot[bot] authored Jul 4, 2024
2 parents 785ec9c + a2e9529 commit 4c25b87
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ rules:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
Expand Down
2 changes: 1 addition & 1 deletion controllers/client/openstackclient_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r *OpenStackClientReconciler) GetLogger(ctx context.Context) logr.Logger {
//+kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;
//+kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch;
// service account, role, rolebinding
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch;create;update
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch;create;update;patch
// +kubebuilder:rbac:groups="rbac.authorization.k8s.io",resources=roles,verbs=get;list;watch;create;update
// +kubebuilder:rbac:groups="rbac.authorization.k8s.io",resources=rolebindings,verbs=get;list;watch;create;update
// service account permissions that are needed to grant permission to the above
Expand Down
6 changes: 0 additions & 6 deletions controllers/core/openstackcontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func (r *OpenStackControlPlaneReconciler) GetLogger(ctx context.Context) logr.Lo
// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile
func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error) {

Log := r.GetLogger(ctx)
// Fetch the OpenStackControlPlane instance
instance := &corev1beta1.OpenStackControlPlane{}
Expand Down Expand Up @@ -263,11 +262,9 @@ func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctr
return ctrl.Result{}, nil
}
}

}

func (r *OpenStackControlPlaneReconciler) reconcileOVNControllers(ctx context.Context, instance *corev1beta1.OpenStackControlPlane, version *corev1beta1.OpenStackVersion, helper *common_helper.Helper) (ctrl.Result, error) {

OVNControllerReady, err := openstack.ReconcileOVNController(ctx, instance, version, helper)
if err != nil {
return ctrl.Result{}, err
Expand All @@ -281,11 +278,9 @@ func (r *OpenStackControlPlaneReconciler) reconcileOVNControllers(ctx context.Co
instance.Status.Conditions.MarkTrue(corev1beta1.OpenStackControlPlaneOVNReadyCondition, corev1beta1.OpenStackControlPlaneOVNReadyMessage)
}
return ctrl.Result{}, nil

}

func (r *OpenStackControlPlaneReconciler) reconcileNormal(ctx context.Context, instance *corev1beta1.OpenStackControlPlane, version *corev1beta1.OpenStackVersion, helper *common_helper.Helper) (ctrl.Result, error) {

ctrlResult, err := openstack.ReconcileCAs(ctx, instance, helper)
if err != nil {
return ctrl.Result{}, err
Expand Down Expand Up @@ -458,7 +453,6 @@ func (r *OpenStackControlPlaneReconciler) reconcileDelete(ctx context.Context, i
helper.GetLogger().Info(fmt.Sprintf("finalizer removed '%s' successfully", helper.GetFinalizer()))

return ctrl.Result{}, nil

}

// fields to index to reconcile when change
Expand Down

0 comments on commit 4c25b87

Please sign in to comment.