# https://argoproj.github.io/argo/workflow-rbac/
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: workflow-role
rules:
  # pod get/watch is used to identify the container IDs of the current pod
  # pod patch is used to annotate the step's outputs back to controller (e.g. artifact location)
  - apiGroups:
      - ""
    resources:
      - pods
    verbs:
      - get
      - watch
      - patch
  # logs get/watch are used to get the pods logs for script outputs, and for log archival
  - apiGroups:
      - ""
    resources:
      - pods/log
    verbs:
      - get
      - watch
  # This allows one workflow to create another.
  # Not needed for the majority of use cases.
  - apiGroups:
      - argoproj.io
    resources:
      - workflows
    verbs:
      - create
      - get