diff --git a/.github/workflows/appsignals-e2e-eks-test.yml b/.github/workflows/appsignals-e2e-eks-test.yml index 1af8c95972..8273519a25 100644 --- a/.github/workflows/appsignals-e2e-eks-test.yml +++ b/.github/workflows/appsignals-e2e-eks-test.yml @@ -135,6 +135,13 @@ jobs: ${{ inputs.test-cluster-name }} \ ${{ env.AWS_DEFAULT_REGION }} \ ${{ env.SAMPLE_APP_NAMESPACE }} + + # If the workflow provides a specific ADOT image to test, record the Image Names in Env to verify if any change after patch + if [ ${{ inputs.appsignals-adot-image-name }} != "" ]; then + echo "OLD_ADOT_IMAGE"=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} -o json | \ + jq '.items[0].status.initContainerStatuses[0].image') >> $GITHUB_ENV + fi + # If the workflow provides a specific ADOT image to test, patch the deployment and restart CW agent related pods if [ ${{ inputs.appsignals-adot-image-name }} != "" ]; then @@ -204,12 +211,24 @@ jobs: echo "REMOTE_SERVICE_DEPLOYMENT_NAME=$(kubectl get deployments -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=remote-app -o jsonpath='{.items[0].metadata.name}')" >> $GITHUB_ENV echo "REMOTE_SERVICE_POD_IP=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=remote-app -o jsonpath='{.items[0].status.podIP}')" >> $GITHUB_ENV - - name: Verify pod Adot image + - name: Log pod Adot image and save image to the environment run: | kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --output json | \ jq '.items[0].status.initContainerStatuses[0].imageID' - - name: Verify pod CWAgent image + echo "NEW_ADOT_IMAGE"=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} -o json | \ + jq '.items[0].status.initContainerStatuses[0].image') >> $GITHUB_ENV + + - name: Verify ADOT Image changed if ADOT Patched + run: | + if [ ${{ inputs.appsignals-adot-image-name }} != "" ]; then + if [ ${{ env.OLD_ADOT_IMAGE }} = ${{ env.NEW_ADOT_IMAGE }} ]; then + echo "ADOT Image did not change" + exit 1 + fi + fi + + - name: Log pod CWAgent image run: | kubectl get pods -n amazon-cloudwatch --output json | \ jq '.items[0].status.containerStatuses[0].imageID'