fix(services/oss): prefer OIDC credentials over ECS metadata - #8339
Merged
Merged
Conversation
Signed-off-by: WenyXu <wenymedia@gmail.com>
WenyXu
marked this pull request as ready for review
September 23, 2026 03:28
3 tasks
Xuanwo
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Closes #8338. Related to #7480.
Rationale for this change
Adding ECS RAM role credentials in #7480 placed instance metadata before OIDC in the OSS credential chain. On ACK, a pod with RRSA configured can therefore use the node role instead of its configured OIDC role when both credential sources are available. Loading credentials succeeds, but OSS can reject the subsequent write because the node role lacks permission.
The reporter observed this against actual Aliyun OSS after upgrading GreptimeDB from v1.0.2 (OpenDAL 0.54.1) to v1.1.0 (OpenDAL 0.57.0), with the same RRSA configuration. CREATE TABLE failed with HTTP 403 while writing the manifest. The reporter confirmed that setting
ALIBABA_CLOUD_ECS_METADATA_DISABLED=trueand restarting restored operation.What changes are included in this PR?
Validation: OSS crate tests (9 unit tests and 2 doc tests). With identical test inputs, reverting only the provider order fails the regression test in both runs; the fixed order passes both runs.
cargo clippy -p opendal-service-oss --all-targets --locked -- -D warningsandcargo fmt --all -- --checkpassed.The patched build has not yet been tested against live OSS. The service evidence above is the reporter's upgrade/workaround comparison; the local test establishes credential selection and signing behavior.
Are there any user-facing changes?
Yes. When both OIDC and ECS instance credentials are available, OSS uses OIDC first. Explicit and environment access keys retain their precedence. ECS remains available when preceding providers return no credentials or fail. An OSS 403 does not trigger a switch to another identity.
Breaking changes
AI Usage Statement