Skip to content

Commit

Permalink
add workflow step to run workflow helper to send webhooks
Browse files Browse the repository at this point in the history
created a new argo template and added it to the end of the adviser workflow and added role to be used by new workflow template
  • Loading branch information
KPostOffice committed Jul 15, 2022
1 parent 1e97968 commit 6ee804a
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
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/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/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
38 changes: 38 additions & 0 deletions core/base/argo-workflows/send-webhooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: trigger-integration
annotations:
operation: workflow-helpers
spec:
templates:
- name: send-webhooks
podSpecPatch: '{"serviceAccountName": "send-webhooks"}'
resubmitPendingPods: true
inputs:
parameters:
- name: document-id
- name: secret-namespace
container:
name: trigger-integration
image: workflow-helpers:latest
env:
- name: THOTH_WORKFLOW_TASK
value: send_webhooks
- name: DOCUMENT_ID
value: "{{inputs.parameters.document-id}}"
- name: THOTH_BACKEND_NAMESPACE
value: "{{inputs.parameters.secret-namespace}}"
- name: WEBHOOK_DIR
value: "/secret/callback"
resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 250m
memory: 256Mi
volumeMounts:
- name: callback-secret
mountPath: "/secret/callback"
2 changes: 2 additions & 0 deletions core/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ resources:
- imagestreams.yaml
- argo-workflows/send-message.yaml
- argo-workflows/send-messages.yaml
- argo-workflows/send-webhooks.yaml
- send-webhooks-sa.yaml
29 changes: 29 additions & 0 deletions core/base/send-webhooks-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: send-webhooks
---
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: send-webhooks
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: delete-secrets
subjects:
- kind: ServiceAccount
name: send-webhooks

0 comments on commit 6ee804a

Please sign in to comment.