Skip to content

Commit 3206c99

Browse files
committed
fix RBAC markers
On-behalf-of: @SAP [email protected]
1 parent 489721d commit 3206c99

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

internal/client/clients.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ func newClient(
8585
return ctrlruntimeclient.New(cfg, ctrlruntimeclient.Options{Scheme: scheme})
8686
}
8787

88+
// +kubebuilder:rbac:groups=core,resources=secrets,verbs=get
89+
8890
func getTLSConfig(ctx context.Context, c ctrlruntimeclient.Client, rootShard *operatorv1alpha1.RootShard, shard *operatorv1alpha1.Shard, frontProxy *operatorv1alpha1.FrontProxy) (rest.TLSClientConfig, error) {
8991
rootShard, err := getRootShard(ctx, c, rootShard, shard, frontProxy)
9092
if err != nil {
@@ -109,6 +111,8 @@ func getTLSConfig(ctx context.Context, c ctrlruntimeclient.Client, rootShard *op
109111
}, nil
110112
}
111113

114+
// +kubebuilder:rbac:groups=operator.kcp.io,resources=rootshards,verbs=get
115+
112116
func getRootShard(ctx context.Context, c ctrlruntimeclient.Client, rootShard *operatorv1alpha1.RootShard, shard *operatorv1alpha1.Shard, frontProxy *operatorv1alpha1.FrontProxy) (*operatorv1alpha1.RootShard, error) {
113117
if rootShard != nil {
114118
return rootShard, nil

internal/client/frontproxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import (
3030
operatorv1alpha1 "github.com/kcp-dev/kcp-operator/sdk/apis/operator/v1alpha1"
3131
)
3232

33+
// +kubebuilder:rbac:groups=operator.kcp.io,resources=rootshards;shards;frontproxies,verbs=get
34+
3335
func NewInternalKubeconfigClient(ctx context.Context, c ctrlruntimeclient.Client, kubeconfig *operatorv1alpha1.Kubeconfig, cluster logicalcluster.Name, scheme *runtime.Scheme) (ctrlruntimeclient.Client, error) {
3436
target := kubeconfig.Spec.Target
3537

internal/controller/kubeconfig-rbac/controller.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,8 @@ func (r *KubeconfigRBACReconciler) SetupWithManager(mgr ctrl.Manager) error {
5151
Complete(r)
5252
}
5353

54-
// +kubebuilder:rbac:groups=operator.kcp.io,resources=kubeconfigs,verbs=get;list;watch;update;patch
55-
// +kubebuilder:rbac:groups=operator.kcp.io,resources=kubeconfigs/status,verbs=get;update;patch
54+
// +kubebuilder:rbac:groups=operator.kcp.io,resources=kubeconfigs,verbs=get;update;patch
5655
// +kubebuilder:rbac:groups=operator.kcp.io,resources=kubeconfigs/finalizers,verbs=update
57-
// +kubebuilder:rbac:groups=operator.kcp.io,resources=rootshards,verbs=get;list;watch
58-
// +kubebuilder:rbac:groups=cert-manager.io,resources=certificates,verbs=get;list;watch;create;update;patch;delete
59-
// +kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch;create;update;patch;delete
6056

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

internal/resources/frontproxy/reconciler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ func NewRootShardProxy(rootShard *operatorv1alpha1.RootShard) *reconciler {
5555
}
5656
}
5757

58+
// +kubebuilder:rbac:groups=core,resources=configmaps;secrets;services,verbs=get;update;patch
59+
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;update;patch
60+
// +kubebuilder:rbac:groups=cert-manager.io,resources=certificates,verbs=get;update;patch
61+
5862
func (r *reconciler) Reconcile(ctx context.Context, client ctrlruntimeclient.Client, namespace string) error {
5963
var errs []error
6064

0 commit comments

Comments
 (0)