← Back to Pull requests

ROSAENG-67145 | feat: support spaces in AWS tag keys and values via quoting #3587

Closed
unknown closed this pull request without merging on Sep 29, 2026 20:24 UTC
View on GitHub
unknown unknown commented on Sep 27, 2026 21:41 UTC
Author

Summary


Align ROSA CLI --tags parsing with OCM cluster service support for spaces in AWS tag keys and values. Unquoted legacy formats (key:value, key value) stay compatible; optional double-quoting enables spaces and : in keys. Also reject reserved aws: keys client-side, allow empty tag values for Classic only (not HCP), and use StringArray for --tags so quoted values are not mangled by pflag CSV parsing.

Jira


  • ROSAENG-67145
  • Type of Change


  • feat

  • fix

  • docs / style / refactor / test / chore / build / ci / perf
  • Testing


  • Unit tests in pkg/aws for quoted/unquoted tags, reserved aws: prefix, Classic vs HCP empty values, and SplitUserTagList

  • buildTagsCommand / command-replay coverage in cmd/create/cluster

  • Quoted tags + reserved-key rejection coverage in cmd/verify/network

  • Local: go test ./pkg/aws/ ./cmd/create/cluster/ ./cmd/verify/network/ ./pkg/helper/machinepools/ ./pkg/options/machinepool/ ./pkg/machinepool/
  • rosa create cluster --help | grep -A2 -- --tags
    # Classic dry-run with spaces
    rosa create cluster ... --tags '"Cost Center":"Finance Team",env:prod' --dry-run
    # HCP should reject empty values
    rosa create cluster --hosted-cp ... --tags 'owner:' --dry-run
    

    E2E coverage

    Classic Day1 (test_rosacli_cluster.go)

  • 56440 (updated): empty tag value on cluster dry-run is allowed

  • 67145: quoted tags with spaces (dry-run accepts); reserved aws: rejected; ambiguous mixed quoted/unquoted list rejected; empty value allowed
  • Classic Day2 (test_rosacli_machine_pool.go)

  • 73469 (updated): help shows --tags stringArray; empty-value no longer treated as invalid

  • 67145: create/describe MP with "Cost Center":"Finance Team",owner:; reserved aws: rejected
  • HCP Day1 (test_rosacli_cluster.go)

  • 67145: empty tag value rejected; reserved aws: rejected
  • HCP Day2 (hcp_machine_pool_test.go, test_rosacli_node_pool.go)

  • 73638 (updated): help shows --tags stringArray; quoted reserved aws: rejected; empty value rejected

  • 67145: create/describe MP with quoted tags containing spaces

  • 73492 (extended): create/describe MP with quoted space tags; empty value rejected
  • Various examples covered by the new implementation:

    | CLI --tags entry | Tags applied (or result) |
    |--------------------|--------------------------|
    | key:value | key = value |
    | key value | key = value |
    | tag1 value:1 | tag1 = value:1 |
    | tag:2 value2 | tag:2 = value2 |
    | key:value,foo:bar | key = value, foo = bar |
    | "Cost Center":"Finance Team" | Cost Center = Finance Team |
    | "Cost Center":prod | Cost Center = prod |
    | env:"value with spaces" | env = value with spaces |
    | "key:with:colons":value | key:with:colons = value |
    | "key:with:colons":"value:with:colons" | key:with:colons = value:with:colons |
    | "Cost Center":"Finance Team",env:prod | Cost Center = Finance Team, env = prod |
    | "Cost Center":finance,tag1 value:1 | Cost Center = finance, tag1 = value:1 |
    | "env":prod,key:"value with spaces" | env = prod, key = value with spaces |
    | "env":prod,"tag:2":value2 | env = prod, tag:2 = value2 |
    | "env":prod,key:value with spaces | Rejected — ambiguous unquoted tag (quote key/value) |
    | "env":prod,tag:2 value2 | Rejected — ambiguous unquoted tag (use "tag:2":value2) |
    | "Cost Center":x,aws:key value | Rejected — ambiguous unquoted tag (use "aws:key":value) |
    | "aws:key":value | Rejected — reserved aws: key prefix |
    | "aws:owned":true | Rejected — reserved aws: key prefix |
    | aws:key value (all-unquoted list) | Rejected — reserved key aws:key |
    | "my:aws:key":value | my:aws:key = value |
    | owner: (Classic) | owner = ` (empty) |
    |
    owner:"" (Classic) | owner = (empty) |
    |
    owner: (HCP) | Rejected — empty values not allowed |
    |
    a:b:c (unquoted) | Rejected — invalid format |
    |
    :value | Rejected — empty key |

    Breaking Changes


    <!-- Does this PR introduce breaking changes? If yes, describe impact and migration -->
  • No breaking changes
  • Checklist


  • Commit format follows OCM-XXXXX | type: description

  • make install-hooks has been run

  • Tests added/updated where appropriate

  • Manually tested the change
  • [ROSAENG-67145]: https://redhat.atlassian.net/browse/ROSAENG-67145?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Summary

    New Features
    Tags can include quoted keys or values with spaces, commas, or colons, and can be supplied as separate command-line arguments.
    Empty tag values are supported for ROSA Classic clusters and machine pools, but not Hosted Control Plane clusters or node pools.

    Bug Fixes
    Tag validation rejects malformed or ambiguous tags, duplicate or empty keys, and reserved
    aws:` keys.
    Reconstructed commands quote tags as needed to preserve values across shells and provide cmd.exe-specific guidance.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: michaelryanmcneill Review duration: 2803m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3587"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository