# This configmap contains the event sources configurations for Artifact gateway

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: artifact-event-source
  labels:
    # do not remove
    argo-events-event-source-version: v0.11
data:
  example-1: |-
    # bucket information
    bucket:
      # name of the bucket
      name: input
    # s3 service endpoint
    endpoint: minio-service.argo-events:9000
    # list of events to subscribe to
    # Visit https://docs.minio.io/docs/minio-bucket-notification-guide.html
    events:
     - s3:ObjectCreated:Put
     - s3:ObjectRemoved:Delete
    # Filters to apply on the key
    # Optional
    # e.g. filter for key that starts with "hello-" and ends with ".txt"
    filter:
      prefix: "hello-"
      suffix: ".txt"
    # type of the connection
    insecure: true
    # accessKey refers to K8s secret that stores the access key
    accessKey:
      # Key within the K8s secret whose corresponding value (must be base64 encoded) is access key
      key: accesskey
      # Name of the K8s secret that contains the access key
      name: artifacts-minio
    # secretKey contains information about K8s secret that stores the secret key
    secretKey:
      # Key within the K8s secret whose corresponding value (must be base64 encoded) is secret key
      key: secretkey
      # Name of the K8s secret that contains the secret key
      name: artifacts-minio

  example-2 : |-
    bucket:
      name: mybucket
    endpoint: minio-service.argo-events:9000
    events:
     - s3:ObjectCreated:Put
    # no filter
    filter:
      prefix: ""
      suffix: ""
    insecure: true
    accessKey:
      key: accesskey
      name: artifacts-minio
    secretKey:
      key: secretkey
      name: artifacts-minio
