Skip to content

Commit f5fc3b3

Browse files
E2E Testing: Fix EKS test candidate image override (#652)
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.
1 parent d6289cc commit f5fc3b3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/appsignals-e2e-eks-test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ jobs:
8888
working-directory: testing/terraform/eks
8989
run: aws s3 cp ${{ env.ENABLEMENT_SCRIPT_S3_BUCKET }} . && unzip -j onboarding.zip
9090

91-
- name: Change ADOT image if main-build
92-
if: inputs.caller-workflow-name == 'main-build'
93-
run: "sed -i 's#image:.*#image: ${{ inputs.appsignals-adot-image-name }}#g' instrumentation.yaml"
94-
9591
- name: Remove log group deletion command
9692
if: always()
9793
working-directory: testing/terraform/eks
@@ -140,6 +136,15 @@ jobs:
140136
${{ env.AWS_DEFAULT_REGION }} \
141137
${{ env.SAMPLE_APP_NAMESPACE }}
142138
139+
# If the workflow provides a specific ADOT image to test, patch the deployment and restart CW agent related pods
140+
if [ ${{ inputs.appsignals-adot-image-name }} != "" ]; then
141+
kubectl patch deploy -namazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' \
142+
-p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args/0", "value": "--auto-instrumentation-java-image=${{ inputs.appsignals-adot-image-name }}"}]'
143+
144+
kubectl delete pods --all -n amazon-cloudwatch
145+
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
146+
fi
147+
143148
kubectl delete pods --all -n ${{ env.SAMPLE_APP_NAMESPACE }}
144149
kubectl wait --for=condition=Ready pod --all -n ${{ env.SAMPLE_APP_NAMESPACE }}
145150

0 commit comments

Comments
 (0)