From 9b1d37ebae1ee6fcd30d7c593bed349710e8599b Mon Sep 17 00:00:00 2001 From: frenzyfriday Date: Wed, 22 Mar 2023 12:10:05 +0100 Subject: [PATCH 1/2] Adds pre commit job for cinder --- ...ck-k8s-operators-cinder-operator-master.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ci-operator/config/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master.yaml b/ci-operator/config/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master.yaml index cc5f4aff7937..1c243a99c205 100644 --- a/ci-operator/config/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master.yaml +++ b/ci-operator/config/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master.yaml @@ -14,6 +14,11 @@ base_images: build_root: from_repository: true images: +- dockerfile_literal: | + FROM src + RUN pip3 install pre-commit + from: src + to: openstack-operator-ci-pre-commit - dockerfile_literal: | FROM src RUN pip3 install python-openstackclient @@ -74,6 +79,18 @@ tests: optional: true steps: workflow: openstack-k8s-operators-test-build-deploy +- as: precommit-check + commands: | + export SKIP=no-commit-to-branch + export GOFLAGS= + export PRE_COMMIT_HOME=/tmp + export GOLANGCI_LINT_CACHE=/tmp + mkdir -p ../operator/ && cp -r . ../operator + cd ../operator + pre-commit run -a --show-diff-on-failure + container: + from: openstack-operator-ci-pre-commit + optional: true zz_generated_metadata: branch: master org: openstack-k8s-operators From f6fc2c5108d76d77f6d2d160a3912c6d99871cf9 Mon Sep 17 00:00:00 2001 From: frenzyfriday Date: Wed, 22 Mar 2023 07:15:47 -0400 Subject: [PATCH 2/2] Adding files modified by make update --- ...ors-cinder-operator-master-presubmits.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/ci-operator/jobs/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master-presubmits.yaml b/ci-operator/jobs/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master-presubmits.yaml index f83fa1ee9d12..e93d7473adb0 100644 --- a/ci-operator/jobs/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master-presubmits.yaml +++ b/ci-operator/jobs/openstack-k8s-operators/cinder-operator/openstack-k8s-operators-cinder-operator-master-presubmits.yaml @@ -297,6 +297,54 @@ presubmits: secret: secretName: result-aggregator trigger: (?m)^/test( | .* )images,?($|\s.*) + - agent: kubernetes + always_run: true + branches: + - ^master$ + - ^master- + cluster: build04 + context: ci/prow/precommit-check + decorate: true + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openstack-k8s-operators-cinder-operator-master-precommit-check + optional: true + rerun_command: /test precommit-check + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=precommit-check + command: + - ci-operator + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )precommit-check,?($|\s.*) - agent: kubernetes always_run: true branches: