Refactor: thread externalID and shared-VPC args through CreateHCPRoles explicitly
@olucasfreitas is already working on this.
Since Jun 10, 2026.
- Dominant language
- Go
- Stars
- 103
- Forks
- 257
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Summary
CreateHCPRoles in cmd/create/accountroles/creators.go currently reads args.externalID, args.route53RoleArn, and args.vpcEndpointRoleArn from package-global CLI state rather than accepting them as explicit parameters.
While this is not a live production risk (the function has no external callers today), it couples the function to the Cobra args global, making it harder to call from non-CLI contexts (e.g. tests, SDK consumers) and potentially causing stale-value bugs if the function is reused across calls in the future.
Desired behaviour
- Add
externalID stringas an explicit parameter toCreateHCPRoles. - Thread
externalIDintobuildRolesCreationInputvia the parameter instead ofargs.externalID. - Consider doing the same for
route53RoleArn/vpcEndpointRoleArn(already passed as parameters, but still mutated intoargsinside the function on lines 328-329). - Update all callers of
CreateHCPRolesto pass the new parameter.
Context
Identified during review of PR #3264 (ROSAENG-57781 — opt-in STS external ID support).
Comment: https://github.com/openshift/rosa/pull/3264#discussion_r3389622445
Requested by: @olucasfreitas
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.