@@ -317,6 +317,21 @@ jobs:
317317 echo "Currently released version is: ${OPERATOR_VERSION}"
318318 echo "export OPERATOR_VERSION=${OPERATOR_VERSION}" >> $BASH_ENV
319319 name : Get last released Operator version
320+ - run :
321+ command : |
322+ LATEST_TAG_WITH_V=`git describe --abbrev=0 --tags ${CIRCLE_SHA1}`
323+ LATEST_TAG=${LATEST_TAG_WITH_V:1}
324+ echo "export LATEST_TAG=${LATEST_TAG}" >> $BASH_ENV
325+ description : |
326+ This tag is used to identify the Operator version we are going to upgrade to.
327+ name : Get latest snyk-monitor tag
328+ - run :
329+ command : |
330+ if [[ "${LATEST_TAG}" == "${OPERATOR_VERSION}" ]]; then
331+ echo "export NOTHING_TO_TEST=true" >> $BASH_ENV
332+ exit 1
333+ fi
334+ name : End tests early if no new Operator is to be released
320335 - run :
321336 command : |
322337 set -xeo pipefail
@@ -415,9 +430,6 @@ jobs:
415430 command : |
416431 set -eo pipefail
417432
418- LATEST_TAG_WITH_V=`git describe --abbrev=0 --tags ${CIRCLE_SHA1}`
419- LATEST_TAG=${LATEST_TAG_WITH_V:1}
420-
421433 REPLACES_VERSION=${OPERATOR_VERSION}
422434
423435 CSV_LOCATION="./snyk-operator/deploy/olm-catalog/snyk-operator"
@@ -489,7 +501,10 @@ jobs:
489501 name : Cleanup
490502 when : always
491503 - run :
492- command : ./scripts/slack/notify_failure.py "nightly-operator-upgrade-tests"
504+ command : |
505+ if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
506+ ./scripts/slack/notify_failure.py "nightly-operator-upgrade-tests"
507+ fi
493508 name : Notify Slack on failure
494509 when : on_fail
495510 working_directory : ~/kubernetes-monitor
@@ -574,6 +589,13 @@ jobs:
574589 NEW_OPERATOR_VERSION=${LATEST_TAG}
575590 echo "export NEW_OPERATOR_VERSION=${NEW_OPERATOR_VERSION}" >> $BASH_ENV
576591 name : Get new Operator version
592+ - run :
593+ command : |
594+ if [[ "${NEW_OPERATOR_VERSION}" == "${LAST_OPERATOR_VERSION}" ]]; then
595+ echo "export NOTHING_TO_TEST=true" >> $BASH_ENV
596+ exit 1
597+ fi
598+ name : End tests early if no new Operator is to be released
577599 - run :
578600 command : |
579601 ./scripts/operator/package-operator.sh "${NEW_OPERATOR_VERSION}" "${NEW_OPERATOR_VERSION}" "${NEW_OPERATOR_VERSION}" "${LAST_OPERATOR_VERSION}"
@@ -613,7 +635,10 @@ jobs:
613635 ./scripts/slack/notify_success_operator_push.py "${NEW_OPERATOR_VERSION}"
614636 name : Notify Slack on new branch in snyk/community-operators
615637 - run :
616- command : ./scripts/slack/notify_failure.py "push-new-operator"
638+ command : |
639+ if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
640+ ./scripts/slack/notify_failure.py "push-new-operator"
641+ fi
617642 name : Notify Slack on failure
618643 when : on_fail
619644 working_directory : ~/kubernetes-monitor
0 commit comments