openshift / openshift/rosa

Refactor: thread externalID and shared-VPC args through CreateHCPRoles explicitly

Open
#3,265 1 comment 0 reactions 1 assignee View on GitHub

@olucasfreitas is already working on this.

Since Jun 10, 2026.

lifecycle/stale
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 string as an explicit parameter to CreateHCPRoles.
  • Thread externalID into buildRolesCreationInput via the parameter instead of args.externalID.
  • Consider doing the same for route53RoleArn / vpcEndpointRoleArn (already passed as parameters, but still mutated into args inside the function on lines 328-329).
  • Update all callers of CreateHCPRoles to 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

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.