# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  creationTimestamp: null
  name: metrics-hpa
spec:
  steps:
    - name: step-00
      try:
        - apply:
            file: 00-install.yaml
        - apply:
            file: mock-server.yaml
        - apply:
            file: metric.yaml
        - apply:
            file: hpa.yaml
        - assert:
            file: deployment.yaml
      catch:
        - podLogs:
            selector: app=podtato-head
        - podLogs:
            namespace: keptn-system
            selector: app=metrics-operator
        - describe:
            apiVersion: metrics.keptn.sh/v1
            kind: KeptnMetric
            name: podtatometric
        - describe:
            apiVersion: metrics.keptn.sh/v1
            kind: KeptnMetricsProvider
            name: dynatrace
        - describe:
            apiVersion: v1
            kind: Pod
            selector: app=podtato-head
