Skip to content

Support Automatic Replacement of Unsupported Characters in Prefix (e.g., / → -) in mas configure-airgap Command #2258

@sunilkumaraar

Description

@sunilkumaraar

Feature and motivation

Currently, the system enforces strict validation rules on prefix values, disallowing certain characters such as /. However, in many real-world use cases—particularly when organizing content into logical groupings or simulating folder-like structures (e.g., bucket-style paths)—users naturally include / as part of the prefix.
When such prefixes are used during mas configure-airgap, they propagate into generated resource names (e.g., ImageDigestMirrorSet / IDMS), which must comply with OpenShift naming conventions (RFC 1123). Since / is not permitted, this results in validation failures.
This limitation introduces:

Validation errors during execution
Additional manual effort to sanitize inputs
Friction for users accustomed to hierarchical naming patterns

Proposed Enhancement
Introduce an automatic sanitization/normalization mechanism within the mas configure-airgap command that:

Detects unsupported characters in prefix values
Replaces them with valid alternatives (e.g., / → -)
Ensures downstream resource names comply with RFC 1123 constraints

Optional Extension (Future Scope)
Allow configurable character mappings, such as:

/ → -
\ → _
space → (remove or replace)

This would provide flexibility for customers to align with their internal naming standards.

Usage example

Current Behavior
While configuring airgap using mascli, if a prefix such as:
test/test

is provided, it becomes part of the generated IDMS name:
mas-ibm-catalog-test/test

This results in an OpenShift validation error:
Invalid value: "mas-ibm-catalog-test/test": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-', or '.', and must start and end with an alphanumeric character

This confirms that the prefix value is directly used in resource naming without sanitization.

Proposed Behavior
Input Prefix: test/test
System transforms to: test-test

Resulting in a valid IDMS name:
mas-ibm-catalog-test-test

This ensures compliance with OpenShift validation rules while preserving the logical intent of the prefix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions