Skip to content

Commit 157dace

Browse files
author
Anton
authored
Fix secret permissions (#161)
1 parent 52275d1 commit 157dace

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

config/crd/bases/atlas.mongodb.com_atlasdatabaseusers.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ spec:
185185
- type
186186
type: object
187187
type: array
188+
connectionSecrets:
189+
additionalProperties:
190+
type: string
191+
type: object
188192
observedGeneration:
189193
description: ObservedGeneration indicates the generation of the resource
190194
specification that the Atlas Operator is aware of. The Atlas Operator

config/rbac/clusterwide/role.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ rules:
1010
resources:
1111
- secrets
1212
verbs:
13+
- create
14+
- delete
1315
- get
1416
- list
17+
- patch
18+
- update
1519
- watch
1620
- apiGroups:
1721
- atlas.mongodb.com

config/rbac/namespaced/role.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ rules:
1111
resources:
1212
- secrets
1313
verbs:
14+
- create
15+
- delete
1416
- get
1517
- list
18+
- patch
19+
- update
1620
- watch
1721
- apiGroups:
1822
- atlas.mongodb.com

pkg/controller/atlasdatabaseuser/atlasdatabaseuser_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ type AtlasDatabaseUserReconciler struct {
4747

4848
// +kubebuilder:rbac:groups=atlas.mongodb.com,resources=atlasdatabaseusers,verbs=get;list;watch;create;update;patch;delete
4949
// +kubebuilder:rbac:groups=atlas.mongodb.com,resources=atlasdatabaseusers/status,verbs=get;update;patch
50+
// +kubebuilder:rbac:groups="",resources=secrets,verbs=create;update;patch;delete
5051

5152
// +kubebuilder:rbac:groups=atlas.mongodb.com,namespace=default,resources=atlasdatabaseusers,verbs=get;list;watch;create;update;patch;delete
5253
// +kubebuilder:rbac:groups=atlas.mongodb.com,namespace=default,resources=atlasdatabaseusers/status,verbs=get;update;patch
54+
// +kubebuilder:rbac:groups="",namespace=default,resources=secrets,verbs=create;update;patch;delete
5355

5456
func (r *AtlasDatabaseUserReconciler) Reconcile(context context.Context, req ctrl.Request) (ctrl.Result, error) {
5557
_ = context

0 commit comments

Comments
 (0)