fix RBAC using '+kubebuilder:rbac:' prefix
All checks were successful
DevStar DevContainer Operator CI Pipeline - main branch / build-and-push-devstar-devcontainer-operator (push) Successful in 1m5s

This commit is contained in:
Mingchen Dai 2024-09-30 09:56:04 +00:00
parent 9335470b9b
commit 15c626593b
No known key found for this signature in database
GPG Key ID: 830D8248E627888A
2 changed files with 22 additions and 6 deletions

@ -4,6 +4,26 @@ kind: ClusterRole
metadata:
name: manager-role
rules:
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- devcontainer.devstar.cn
resources:
@ -30,9 +50,3 @@ rules:
- get
- patch
- update
- apiGroups: [""]
resources: ["services"]
verbs: ["create", "delete", "get", "list", "watch"]
- apiGroups: ["apps"]
resources: ["statefulsets"]
verbs: ["create", "delete", "get", "list", "watch"]

@ -43,6 +43,8 @@ type DevcontainerAppReconciler struct {
// +kubebuilder:rbac:groups=devcontainer.devstar.cn,resources=devcontainerapps,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=devcontainer.devstar.cn,resources=devcontainerapps/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=devcontainer.devstar.cn,resources=devcontainerapps/finalizers,verbs=update
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=create;delete;get;list;watch
// +kubebuilder:rbac:groups="",resources=services,verbs=create;delete;get;list;watch
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.