# Copyright (c) 2020 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

apiVersion: batch/v1
kind: Job
metadata:
  name: e2e-tests
spec:
  template:
    spec:
      containers:
      - name: configs
        image: docker.io/curlimages/curl
        command: ["/bin/sh",  "-c"]
        args: ["curl -s http://gatekeeper-policy-manager.gatekeeper-system.svc.cluster.local/configs/ | grep 'kube-system'"]
      - name: constrainttemplates
        image: docker.io/curlimages/curl
        command: ["/bin/sh",  "-c"]
        args: ["curl -s http://gatekeeper-policy-manager.gatekeeper-system.svc.cluster.local/constrainttemplates/ | grep 'Target admission.k8s.gatekeeper.sh'"]
      - name: constraints
        image: docker.io/curlimages/curl
        command: ["/bin/sh",  "-c"]
        args: ["curl -s http://gatekeeper-policy-manager.gatekeeper-system.svc.cluster.local/constraints/ | grep 'local-path-provisioner in the Deployment local-path-provisioner does not have a memory limit set'"]
      restartPolicy: Never
  backoffLimit: 10
