From ca31e8e7d77277778df9fd08c73048d15abadd16 Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Tue, 7 Jul 2026 11:20:44 +0100 Subject: [PATCH] Allow verify directories to already exist Allow the hypershift and client-fo directories to already exist. This means that when you use `/testwith`, which clones the working code out from another PR, we can leverage that code rather than the main branch content. --- .../config/openshift/api/openshift-api-master.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ci-operator/config/openshift/api/openshift-api-master.yaml b/ci-operator/config/openshift/api/openshift-api-master.yaml index 2934865a515a5..bad5508b7f7a1 100644 --- a/ci-operator/config/openshift/api/openshift-api-master.yaml +++ b/ci-operator/config/openshift/api/openshift-api-master.yaml @@ -83,7 +83,9 @@ tests: - as: verify-client-go commands: | dir=$GOPATH/src/github.com/openshift/client-go - git clone https://github.com/openshift/client-go --branch ${PULL_BASE_REF:-master} --single-branch $dir + if [ ! -d $dir ]; then + git clone https://github.com/openshift/client-go --branch ${PULL_BASE_REF:-master} --single-branch $dir + fi rm -rf $dir/vendor/github.com/openshift/api/* cp -Rf ./ $dir/api/ rm -rf $dir/api/vendor @@ -99,8 +101,12 @@ tests: - as: verify-hypershift-integration commands: | dir=$GOPATH/src/github.com/openshift/hypershift - git clone https://github.com/openshift/hypershift --branch main --single-branch $dir - git clone https://github.com/openshift/client-go --branch master --single-branch $dir/openshift-client-go + if [ ! -d $dir ]; then + git clone https://github.com/openshift/hypershift --branch main --single-branch $dir + fi + if [ ! -d $dir/openshift-client-go ]; then + git clone https://github.com/openshift/client-go --branch master --single-branch $dir/openshift-client-go + fi rm -rf $dir/vendor/github.com/openshift/api/* rm -rf $dir/vendor/github.com/openshift/client-go/* cp -Rf ./ $dir/openshift-api/