Skip to content

Commit

Permalink
E2E Testing: Fix EKS test candidate image override (#652)
Browse files Browse the repository at this point in the history
This change checks if there is an adot image passed to the workflow and patches the App Signals deployment to update the image and restarts the cloudwatch pods.
  • Loading branch information
majanjua-amzn authored Dec 15, 2023
1 parent d6289cc commit f5fc3b3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/appsignals-e2e-eks-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ jobs:
working-directory: testing/terraform/eks
run: aws s3 cp ${{ env.ENABLEMENT_SCRIPT_S3_BUCKET }} . && unzip -j onboarding.zip

- name: Change ADOT image if main-build
if: inputs.caller-workflow-name == 'main-build'
run: "sed -i 's#image:.*#image: ${{ inputs.appsignals-adot-image-name }}#g' instrumentation.yaml"

- name: Remove log group deletion command
if: always()
working-directory: testing/terraform/eks
Expand Down Expand Up @@ -140,6 +136,15 @@ jobs:
${{ env.AWS_DEFAULT_REGION }} \
${{ env.SAMPLE_APP_NAMESPACE }}
# 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
kubectl patch deploy -namazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' \
-p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args/0", "value": "--auto-instrumentation-java-image=${{ inputs.appsignals-adot-image-name }}"}]'
kubectl delete pods --all -n amazon-cloudwatch
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
fi
kubectl delete pods --all -n ${{ env.SAMPLE_APP_NAMESPACE }}
kubectl wait --for=condition=Ready pod --all -n ${{ env.SAMPLE_APP_NAMESPACE }}
Expand Down

0 comments on commit f5fc3b3

Please sign in to comment.