Propagate command context through IAM and creator AWS operations
Open
@markirish is already working on this.
Since Sep 4, 2026.
- Dominant language
- Go
- Stars
- 103
- Forks
- 257
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Summary
Propagate the command context.Context through IAM role and policy operations and through the creator lookup.
Rationale
The IAM service-account create command receives a command context. The current creator lookup and role bridge do not propagate that context to the underlying AWS operations. A cancelled command can therefore remain blocked in an AWS call.
Required changes
- Add context-accepting AWS client APIs for the creator lookup and IAM role/policy operations.
- Update
pkg/aws/rolebridgeto pass the supplied context to those APIs. - Update
cmd/create/iamserviceaccount/cmd.goto use the context-aware creator lookup and IAM adapter. - Preserve cancellation and timeout behavior for
EnsureRole,AttachRolePolicy, andPutRolePolicy. - Add tests that verify context propagation and cancellation behavior.
Affected areas
cmd/create/iamserviceaccount/cmd.gopkg/aws/rolebridge- AWS client interfaces and implementations that provide creator and IAM operations
Acceptance criteria
- The command context reaches the creator lookup and all IAM role/policy AWS calls.
- Cancellation or deadline expiry stops the affected AWS operations when the AWS SDK supports it.
- Tests cover forwarding of the command context through the adapter and client APIs.
Backlinks
- Pull request: https://github.com/openshift/rosa/pull/3482
- Review comment: https://github.com/openshift/rosa/pull/3482#discussion_r3927336183
- Requested by: @markirish
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.