Skip to content

fix: ECS IMDS v2 to v1 fallback after token; enableIMDSv2=false - #47

Merged
yndu13 merged 2 commits into
masterfrom
fix/aone-85433568-imds-v1-fallback
Aug 18, 2026
Merged

fix: ECS IMDS v2 to v1 fallback after token; enableIMDSv2=false#47
yndu13 merged 2 commits into
masterfrom
fix/aone-85433568-imds-v1-fallback

Conversation

@yndu13

@yndu13 yndu13 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix IMDSv1 fallback when token succeeds but later metadata GET fails (disableIMDSv1=false).
  • Default remains try IMDSv2 first with exception fallback; remove the newly added enableIMDSv2 skip switch.
  • Keep disableIMDSv1=true as fail-fast without V1 retry.

Also allow enableIMDSv2=false (or ALIBABA_CLOUD_ECS_IMDSV2_ENABLE=false)
to skip the IMDSv2 probe on private clouds without hardening mode.
@yndu13 yndu13 self-assigned this Aug 14, 2026
@codecov-commenter

codecov-commenter commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.34%. Comparing base (477ceb9) to head (9fe68c4).

Files with missing lines Patch % Lines
src/Providers/EcsRamRoleCredentialsProvider.php 94.11% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (95.34%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #47      +/-   ##
============================================
- Coverage     95.36%   95.34%   -0.02%     
- Complexity      749      757       +8     
============================================
  Files            34       34              
  Lines          1983     1998      +15     
============================================
+ Hits           1891     1905      +14     
- Misses           92       93       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Review feedback: remove the newly added enable-V2 request switch.
Always try IMDSv2 by default; on any V2-path failure (token or later
metadata GET), fall back to IMDSv1 unless disableIMDSv1 is true.
@yndu13
yndu13 merged commit 71e2876 into master Aug 18, 2026
12 checks passed
@yndu13
yndu13 deleted the fix/aone-85433568-imds-v1-fallback branch August 18, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants