From 05400a3e33bf3bb306a203bfca202ad29e5ebb38 Mon Sep 17 00:00:00 2001 From: Arjun Kondur Date: Thu, 24 Oct 2024 16:50:45 -0500 Subject: [PATCH] Test again --- .github/workflows/build-test-push-workflow.yml | 9 +-------- test/run-tests.sh | 10 ++-------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-test-push-workflow.yml b/.github/workflows/build-test-push-workflow.yml index 2f6140b46..0fa02a8d2 100644 --- a/.github/workflows/build-test-push-workflow.yml +++ b/.github/workflows/build-test-push-workflow.yml @@ -87,13 +87,9 @@ jobs: - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - - name: Make Splunk Operator Image + - name: Build and push Splunk Operator Image run: | make docker-buildx IMG=${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA - - name: Push Splunk Operator Image to ECR - run: | - echo "Uploading Image to ECR:: ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA" - make docker-push IMG=${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ github.sha }} - name: Sign Splunk Operator image with a key run: | cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ github.sha }} @@ -258,9 +254,6 @@ jobs: run: | docker tag ${{ env.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }} docker push ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }} - - name: Pull Splunk Operator Image Locally - run: | - docker pull ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA - name: Create EKS cluster run: | export EKS_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }} diff --git a/test/run-tests.sh b/test/run-tests.sh index 429a6e84c..96b714c43 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -20,9 +20,10 @@ if [ -n "${PRIVATE_REGISTRY}" ]; then PRIVATE_SPLUNK_OPERATOR_IMAGE=${PRIVATE_REGISTRY}/${SPLUNK_OPERATOR_IMAGE} PRIVATE_SPLUNK_ENTERPRISE_IMAGE=${PRIVATE_REGISTRY}/${SPLUNK_ENTERPRISE_IMAGE} - echo "docker images -q ${PRIVATE_SPLUNK_OPERATOR_IMAGE}" + echo "Checking to see if image exists, docker images -q ${PRIVATE_SPLUNK_OPERATOR_IMAGE}" # Don't pull splunk operator if exists locally since we maybe building it locally if [ -z $(docker images -q ${PRIVATE_SPLUNK_OPERATOR_IMAGE}) ]; then + echo "Doesn't exist, pulling ${PRIVATE_SPLUNK_OPERATOR_IMAGE}..." docker pull ${PRIVATE_SPLUNK_OPERATOR_IMAGE} if [ $? -ne 0 ]; then echo "Unable to pull ${SPLUNK_OPERATOR_IMAGE}. Exiting..." @@ -30,13 +31,6 @@ if [ -n "${PRIVATE_REGISTRY}" ]; then fi fi - #docker tag ${SPLUNK_OPERATOR_IMAGE} ${PRIVATE_SPLUNK_OPERATOR_IMAGE} - #docker push ${PRIVATE_SPLUNK_OPERATOR_IMAGE} - #if [ $? -ne 0 ]; then - # echo "Unable to push ${PRIVATE_SPLUNK_OPERATOR_IMAGE}. Exiting..." - # exit 1 - #fi - # Always attempt to pull splunk enterprise image docker pull ${SPLUNK_ENTERPRISE_IMAGE} if [ $? -ne 0 ]; then