sabre1041 / sabre1041.eda

Event Driven Automation
Apache License 2.0
14 stars 5 forks source link

Listener stops listening after a few minutes #3

Open davidfox79 opened 5 months ago

davidfox79 commented 5 months ago

After a few minutes of inactivity (i.e no events related to the kind being watched) the listener stops listening (stops receiving events from the K8s API). Here's my rulebook:


- name: Listen for newly added Secret resources
  hosts: all
  sources:
    - sabre1041.eda.k8s:
        api_version: v1
        kind: Secret
        api_key: "{{ api_key }}"
        host: "{{ host }}"
        validate_certs: false

  rules:
    - name: Notify added
      condition: event.type == "ADDED"
      action:
        debug:                                                                                                                                                                                                           
          msg: "A new Secret was added: {{ event }}"

    - name: Notify modified
      condition: event.type == "MODIFIED"
      action:
        debug:                                                                                                                                                                                                           
          msg: "A new Secret was modified: {{ event }}"