openshift / openshift/rosa

Propagate command context through IAM and creator AWS operations

Open
#3,501 0 comments 0 reactions 1 assignee View on GitHub

@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/rolebridge to pass the supplied context to those APIs.
  • Update cmd/create/iamserviceaccount/cmd.go to use the context-aware creator lookup and IAM adapter.
  • Preserve cancellation and timeout behavior for EnsureRole, AttachRolePolicy, and PutRolePolicy.
  • Add tests that verify context propagation and cancellation behavior.

Affected areas

  • cmd/create/iamserviceaccount/cmd.go
  • pkg/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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.