From 108d45f211fceafef99f4868b47d72d8d93254d8 Mon Sep 17 00:00:00 2001 From: Michalis Kargakis Date: Wed, 17 Oct 2018 12:24:08 +0200 Subject: [PATCH] osa: add daily job that tests production deployments --- .../openshift-openshift-azure-periodics.yaml | 51 +++++++++++++++++++ .../cluster-launch-e2e-azure.yaml | 19 +++++++ 2 files changed, 70 insertions(+) diff --git a/ci-operator/jobs/openshift/openshift-azure/openshift-openshift-azure-periodics.yaml b/ci-operator/jobs/openshift/openshift-azure/openshift-openshift-azure-periodics.yaml index fad0f18aa5623..d079842736901 100644 --- a/ci-operator/jobs/openshift/openshift-azure/openshift-openshift-azure-periodics.yaml +++ b/ci-operator/jobs/openshift/openshift-azure/openshift-openshift-azure-periodics.yaml @@ -218,3 +218,54 @@ periodics: sources: - secret: name: cluster-secrets-azure-file +- agent: kubernetes + cron: "" + decorate: true + interval: 24h + name: azure-test-production-resource-provider + skip_cloning: true + spec: + containers: + - args: + - --secret-dir=/usr/local/e2e-secrets/azure + - --target=[output:stable:sync] + - --target=e2e-azure + - --template=/usr/local/e2e-azure + command: + - ci-operator + env: + - name: CLUSTER_TYPE + value: azure + - name: CONFIG_SPEC + valueFrom: + configMapKeyRef: + key: openshift-openshift-azure-master.yaml + name: ci-operator-configs + - name: JOB_NAME_SAFE + value: e2e-azure + - name: TEST_IN_PRODUCTION + value: "true" + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + limits: + cpu: 500m + requests: + cpu: 10m + volumeMounts: + - mountPath: /usr/local/e2e-secrets/azure + name: cluster-secrets-azure-file + - mountPath: /usr/local/e2e-azure + name: job-definition + subPath: cluster-launch-e2e-azure.yaml + serviceAccountName: ci-operator + volumes: + - name: cluster-secrets-azure-file + projected: + sources: + - secret: + name: cluster-secrets-azure-file + - configMap: + name: prow-job-cluster-launch-e2e-azure + name: job-definition diff --git a/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml b/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml index 3a1b32071d176..eaf5d5abef11a 100644 --- a/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml +++ b/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml @@ -17,6 +17,7 @@ parameters: - name: CLUSTER_TYPE value: "azure" required: true +- name: TEST_IN_PRODUCTION objects: @@ -74,6 +75,8 @@ objects: env: - name: HOME value: /tmp/shared/home + - name: TEST_IN_PRODUCTION + value: ${TEST_IN_PRODUCTION} command: - /bin/bash - -c @@ -82,6 +85,12 @@ objects: # error handling and sync code set -euo pipefail + if [[ -n ${TEST_IN_PRODUCTION} ]]; then + # If we are testing in production then currently + # we don't have any _data locally to run openshift e2es. + exit 0 + fi + trap 'touch /tmp/shared/exit' EXIT trap 'kill $(jobs -p); exit 0' TERM @@ -134,6 +143,8 @@ objects: value: "true" - name: RESOURCEGROUP_TTL value: 4h + - name: TEST_IN_PRODUCTION + value: ${TEST_IN_PRODUCTION} command: - /bin/bash - -c @@ -184,12 +195,20 @@ objects: value: ${CLUSTER_TYPE} - name: HOME value: /tmp/shared/home + - name: TEST_IN_PRODUCTION + value: ${TEST_IN_PRODUCTION} command: - /bin/bash - -c - | #!/bin/bash + if [[ -n ${TEST_IN_PRODUCTION} ]]; then + # If we are testing in production then teardown + # happens as part of the e2e framework. + exit 0 + fi + # teardown is collecting debug data and deleting all used resources function teardown() { set +e