Skip to content

Commit

Permalink
kubebuilder: fix autogeneration of manager rbac
Browse files Browse the repository at this point in the history
Controller was missing kubebuilder markers
  • Loading branch information
zimnx committed Nov 3, 2020
1 parent 4c029f7 commit b669ef6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -54,6 +54,7 @@ manifests:
rbac:roleName=manager-role output:rbac:artifacts:config=config/operator/rbac \
webhook output:webhook:artifacts:config=config/operator/webhook

controller-gen $(CRD_OPTIONS) paths="./pkg/controllers/manager" rbac:roleName=manager-role output:rbac:artifacts:config=config/manager/rbac
kustomize build config/operator/default > examples/generic/operator.yaml
kustomize build config/operator/default > examples/gke/operator.yaml
kustomize build config/operator/default > examples/eks/operator.yaml
Expand Down
7 changes: 7 additions & 0 deletions pkg/controllers/manager/manager_controller.go
Expand Up @@ -105,6 +105,13 @@ func discoverManager(ctx context.Context, mgr mgr.Manager) (*mermaidclient.Clien
return &manager, nil
}

// +kubebuilder:rbac:groups="",resources=events,verbs=create;update;patch
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list
// +kubebuilder:rbac:groups=scylla.scylladb.com,resources=scyllaclusters,verbs=get;list;watch
// +kubebuilder:rbac:groups=scylla.scylladb.com,resources=scyllaclusters/status,verbs=get;list;watch;update;patch
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=services,verbs=get;list

func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
ctx := context.Background()
logger := r.Logger.With("cluster", req.NamespacedName)
Expand Down

0 comments on commit b669ef6

Please sign in to comment.