Skip to content

Commit

Permalink
controller: Add RBAC annotations for kubebuilder (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomvariable authored and k8s-ci-robot committed Oct 17, 2018
1 parent 19274b2 commit ce2b096
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
32 changes: 32 additions & 0 deletions config/rbac/rbac_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- awsprovider.k8s.io
resources:
- awsclusterproviderconfigs
- awsclusterproviderstatuses
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- awsprovider.k8s.io
resources:
- awsmachineproviderconfigs
- awsmachineproviderstatuses
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
13 changes: 13 additions & 0 deletions config/rbac/rbac_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
creationTimestamp: null
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: manager-role
subjects:
- kind: ServiceAccount
name: default
namespace: system
1 change: 1 addition & 0 deletions pkg/controller/add_cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/manager"
)

//+kubebuilder:rbac:groups=awsprovider.k8s.io,resources=awsclusterproviderconfigs;awsclusterproviderstatuses,verbs=get;list;watch;create;update;patch;delete
func init() {
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager.
AddToManagerFuncs = append(AddToManagerFuncs, func(m manager.Manager) error {
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/add_machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/manager"
)

//+kubebuilder:rbac:groups=awsprovider.k8s.io,resources=awsmachineproviderconfigs;awsmachineproviderstatuses,verbs=get;list;watch;create;update;patch;delete
func init() {
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager.
AddToManagerFuncs = append(AddToManagerFuncs, func(m manager.Manager) error {
Expand Down

0 comments on commit ce2b096

Please sign in to comment.