openshift / openshift/rosa

Standardize shell-safe rendering of recreated CLI commands

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

@michaelryanmcneill is already working on this.

Since Sep 11, 2026.

Dominant language
Go
Stars
103
Forks
257
Avg merge
2d 21h
Merged PRs (30d)
43

Description

Summary

Define and implement a consistent shell-safe rendering policy for recreated ROSA CLI commands.

Rationale

buildCommand renders a command for users to copy into a shell. It does not execute that command. Several user-controlled values are inserted into the rendered command without shell quoting. This includes comma-joined flag values and other string arguments. A targeted change for one flag would be inconsistent.

Affected areas

  • cmd/create/cluster/cmd.go, especially buildCommand
  • Equivalent recreated-command renderers in other CLI commands, if present
  • Shared command-rendering or quoting helpers in pkg/helper
  • Unit tests for command rendering

Required changes

  1. Define which generated command values require shell-safe quoting.
  2. Select or extend a shared helper for POSIX-shell-safe argument rendering.
  3. Apply the policy consistently to recreated commands and their user-controlled arguments.
  4. Preserve command semantics for normal values, lists, and intentionally empty values.
  5. Add focused tests for spaces, quotes, shell metacharacters, and comma-joined values.

Acceptance criteria

  • Generated recreation commands remain copy-paste safe for supported user input.
  • Similar value types use the same quoting policy.
  • Tests cover the shell-sensitive input cases.
  • Documentation or code comments state the rendering policy and its scope.

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.