Skip to content

Commit 22cd5f5

Browse files
committed
make operator run as non root
Signed-off-by: Georgy Khromov <[email protected]>
1 parent d9cbb67 commit 22cd5f5

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

api/v1alpha1/argocdrolebinding_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ type ArgoCDRoleBindingSpec struct {
2929
ArgoCDRoleRef ArgoCDRoleRef `json:"argocdRoleRef"`
3030
}
3131

32-
// Kind of the subject (sso, local).
32+
// Subject defines the subject being bound to ArgoCDRole.
3333
type Subject struct {
3434
// +kubebuilder:validation:Enum=sso;local;role
35+
// Kind of the subject (sso, local or role).
3536
Kind string `json:"kind"`
3637
// Name of the subject. If Kind is "role", it shouldn't start with "role:"
3738
Name string `json:"name"`
3839
}
3940

40-
// argocdRoleRef defines the reference to the role being granted.
41+
// ArgocdRoleRef defines the reference to the role being granted.
4142
type ArgoCDRoleRef struct {
4243
// Name of the ArgoCDRole. Should not start with "role:"
4344
Name string `json:"name"`

config/crd/bases/rbac-operator.argoproj-labs.io_argocdrolebindings.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ spec:
4040
description: ArgoCDRoleBindingSpec defines the desired state of ArgoCDRoleBinding
4141
properties:
4242
argocdRoleRef:
43-
description: |-
44-
argocdRoleRef defines the reference to the role being granted.
43+
description: ArgocdRoleRef defines the reference to the role being
44+
granted.
4545
properties:
4646
name:
4747
description: Name of the ArgoCDRole. Should not start with "role:"
@@ -52,9 +52,10 @@ spec:
5252
subjects:
5353
description: List of subjects being bound to ArgoCDRole (argocdRoleRef).
5454
items:
55+
description: Subject defines the subject being bound to ArgoCDRole.
5556
properties:
5657
kind:
57-
description: Kind of the subject (sso, local).
58+
description: Kind of the subject (sso, local or role).
5859
enum:
5960
- sso
6061
- local

config/crd/bases/rbac-operator.argoproj-labs.io_argocdroles.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ spec:
4040
description: ArgoCDRoleSpec defines the desired state of Role
4141
properties:
4242
rules:
43-
description: Rules define the desired set of permissions.
4443
items:
44+
description: Rules define the desired set of permissions.
4545
properties:
4646
objects:
47-
description: |-
48-
List of resource's objects the permissions are granted for.
47+
description: List of resource's objects the permissions are
48+
granted for.
4949
items:
5050
type: string
5151
type: array
@@ -65,8 +65,8 @@ spec:
6565
- extensions
6666
type: string
6767
verbs:
68-
description: |-
69-
Verbs define the operations that are being performed on the resource.
68+
description: Verbs define the operations that are being performed
69+
on the resource.
7070
items:
7171
type: string
7272
type: array
@@ -83,8 +83,8 @@ spec:
8383
description: ArgoCDRoleStatus defines the observed state of Role
8484
properties:
8585
argocdRoleBindingRef:
86-
description: |-
87-
argocdRoleBindingRef defines the reference to the ArgoCDRoleBinding Resource.
86+
description: argocdRoleBindingRef defines the reference to the ArgoCDRoleBinding
87+
Resource.
8888
type: string
8989
conditions:
9090
description: Conditions defines the list of conditions.

config/manager/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: controller
8-
newTag: latest
7+
newName: quay.io/argoprojlabs/argocd-rbac-operator
8+
newTag: v0.1.2

config/manager/manager.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ spec:
6262
image: controller:latest
6363
name: manager
6464
securityContext:
65-
allowPrivilegeEscalation: false
6665
capabilities:
67-
drop:
68-
- "ALL"
66+
drop:
67+
- ALL
68+
allowPrivilegeEscalation: false
69+
readOnlyRootFilesystem: true
70+
runAsNonRoot: true
71+
seccompProfile:
72+
type: RuntimeDefault
6973
livenessProbe:
7074
httpGet:
7175
path: /healthz

0 commit comments

Comments
 (0)