Skip to content

Commit

Permalink
add new role and role binding for adviser
Browse files Browse the repository at this point in the history
add role which will be used for adviser workflows so that secrets created for callback urls can be deleted
  • Loading branch information
KPostOffice committed Jul 11, 2022
1 parent eb5adee commit 2801047
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 0 deletions.
29 changes: 29 additions & 0 deletions adviser/base/adviser-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: adviser
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: delete-secrets
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- delete # for wfh send webhooks step
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: adviser
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: delete-secrets
subjects:
- kind: ServiceAccount
name: adviser
1 change: 1 addition & 0 deletions adviser/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ resources:
- openshift-templates/adviser.yaml
- openshift-templates/dependency-monkey.yaml
- openshift-templates/provenance-checker.yaml
- adviser-sa.yaml
- imagestream.yaml
- configmap.yaml
6 changes: 6 additions & 0 deletions adviser/overlays/aws-prod/adviser-rolebinding-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: add
path: /metadata/namespace
value: thoth-backend-prod
- op: add
path: /subjects/0/namespace
value: thoth-backend-prod
7 changes: 7 additions & 0 deletions adviser/overlays/aws-prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,10 @@ patches:
version: v1alpha1
kind: WorkflowTemplate
name: dm
# workflow helpers patch rolebinding
- path: adviser-rolebinding-patch.yaml
target:
group: apps
version: v1
kind: RoleBinding
name: adviser
6 changes: 6 additions & 0 deletions adviser/overlays/moc-prod/adviser-rolebinding-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: add
path: /metadata/namespace
value: thoth-backend-prod
- op: add
path: /subjects/0/namespace
value: thoth-backend-prod
6 changes: 6 additions & 0 deletions adviser/overlays/moc-prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,9 @@ patches:
version: v1alpha1
kind: WorkflowTemplate
name: dm
- path: adviser-rolebinding-patch.yaml
target:
group: apps
version: v1
kind: RoleBinding
name: adviser
6 changes: 6 additions & 0 deletions adviser/overlays/ocp4-stage/adviser-rolebinding-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: add
path: /metadata/namespace
value: thoth-backend-stage
- op: add
path: /subjects/0/namespace
value: thoth-backend-stage
6 changes: 6 additions & 0 deletions adviser/overlays/ocp4-stage/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,9 @@ patches:
version: v1alpha1
kind: WorkflowTemplate
name: dm
- path: adviser-rolebinding-patch.yaml
target:
group: apps
version: v1
kind: RoleBinding
name: adviser

0 comments on commit 2801047

Please sign in to comment.