Skip to content

Commit

Permalink
fix(rbac): Fix rbac permissions (#25)
Browse files Browse the repository at this point in the history
Some permissions were not generated correctly and other permissions were
missing an apiGroup definition.

Tested locally.
  • Loading branch information
akosveres authored Jul 28, 2022
1 parent 92e146b commit 0ffdc1a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions config/rbac/api_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: api-editor-role
rules:
- apiGroups:
- check.checklyhq.com
- k8s.checklyhq.com
resources:
- apis
verbs:
Expand All @@ -17,7 +17,7 @@ rules:
- update
- watch
- apiGroups:
- check.checklyhq.com
- k8s.checklyhq.com
resources:
- apis/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/api_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
name: api-viewer-role
rules:
- apiGroups:
- check.checklyhq.com
- k8s.checklyhq.com
resources:
- apis
verbs:
- get
- list
- watch
- apiGroups:
- check.checklyhq.com
- k8s.checklyhq.com
resources:
- apis/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/checkly_alertchannel_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: alertchannel-editor-role
rules:
- apiGroups:
- checkly.checklyhq.com
- k8s.checklyhq.com
resources:
- alertchannels
verbs:
Expand All @@ -17,7 +17,7 @@ rules:
- update
- watch
- apiGroups:
- checkly.checklyhq.com
- k8s.checklyhq.com
resources:
- alertchannels/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/checkly_alertchannel_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
name: alertchannel-viewer-role
rules:
- apiGroups:
- checkly.checklyhq.com
- k8s.checklyhq.com
resources:
- alertchannels
verbs:
- get
- list
- watch
- apiGroups:
- checkly.checklyhq.com
- k8s.checklyhq.com
resources:
- alertchannels/status
verbs:
Expand Down
4 changes: 3 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ metadata:
creationTimestamp: null
name: manager-role
rules:
- resources:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
Expand Down
8 changes: 4 additions & 4 deletions controllers/checkly/alertchannel_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ type AlertChannelReconciler struct {
ApiClient checkly.Client
}

//+kubebuilder:rbac:groups=checkly.checklyhq.com,resources=alertchannels,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=checkly.checklyhq.com,resources=alertchannels/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=checkly.checklyhq.com,resources=alertchannels/finalizers,verbs=update
//+kubebuilder:rbac:groups=,resources=secrets,verbs=get;list
//+kubebuilder:rbac:groups=k8s.checklyhq.com,resources=alertchannels,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=k8s.checklyhq.com,resources=alertchannels/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=k8s.checklyhq.com,resources=alertchannels/finalizers,verbs=update
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down

0 comments on commit 0ffdc1a

Please sign in to comment.