feat: Search-and-Replace Image Patching #409
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this pull request do?
Replace hardcoded array index-based patching with a search-and-replace approach for updating ADOT instrumentation images in our EKS test deployments.
The solution uses
jqto find the correct argument by pattern matching.Problem
The current implementation uses hardcoded array indices to patch deployment arguments:
args[2]args[3]args[4]args[5]This approach is fragile and will break if:
Which is what has happened here (notice new args were added in the deployment config).
Before
After
Test strategy
1. Functional Testing with Real EKS Deployment
Retrieved actual deployment configuration from e2e-playground cluster and verified both approaches produce identical results:
2. Edge Case Testing Results
Tested five critical edge cases with the actual deployment configuration:
Non-existent argument patch
--auto-instrumentation-go-image(doesn't exist)Reordered arguments
New arguments inserted
--new-feature-flag=enabledinstead of Java imageSequential patches
Malformed arguments
3. Test Commands Used
Test Files
Rollback procedure:
We can safely rollback these changes by reverting the commit.
Ensure you've run the following tests on your changes and include the link below:
To do so, create a
test.ymlfile withname: Testand workflow description to test your changes, then remove the file for your PR. Link your test run in your PR description. This process is a short term solution while we work on creating a staging environment for testing.NOTE: TESTS RUNNING ON A SINGLE EKS CLUSTER CANNOT BE RUN IN PARALLEL. See the needs keyword to run tests in succession.
e2e-playgroundin us-east-1 and eu-central-2e2e-playgroundin us-east-1 and eu-central-2e2e-playgroundin us-east-1 and eu-central-2By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.