---
rule_files:
- /tmp/manifests/prometheus_alerts.yaml
- /tmp/manifests/prometheus_rules.yaml

evaluation_interval: 1m

tests:
- interval: 1m
  input_series:
  - series: 'sealed_secrets_controller_unseal_errors_total{reason="update",namespace="test"}'
    values: '0+0x5 1+1x5'
  - series: 'sealed_secrets_controller_unseal_errors_total{reason="unseal",namespace="test"}'
    values: '0+0x10'
  alert_rule_test:
  - eval_time: 5m
    alertname: SealedSecretsUnsealErrorHigh
  - eval_time: 10m
    alertname: SealedSecretsUnsealErrorHigh
    exp_alerts:
    - exp_labels:
        severity: warning
        namespace: test
        reason: update
      exp_annotations:
        summary: 'Sealed Secrets Unseal Error High'
        description: 'High number of errors during unsealing Sealed Secrets in test namespace.'
        runbook_url: 'https://github.com/bitnami-labs/sealed-secrets'
