Skip to content

OCPBUGS-66943: Validate cluster name against Azure reserved words#10221

Merged
openshift-merge-bot[bot] merged 3 commits intoopenshift:mainfrom
gpei:validate_azure_preserve_name
Jan 15, 2026
Merged

OCPBUGS-66943: Validate cluster name against Azure reserved words#10221
openshift-merge-bot[bot] merged 3 commits intoopenshift:mainfrom
gpei:validate_azure_preserve_name

Conversation

@gpei
Copy link
Contributor

@gpei gpei commented Jan 14, 2026

Azure prohibits certain reserved words and trademarks in resource names that have accessible endpoints (such as FQDNs). This change adds validation to reject cluster names that violate Azure's reserved word restrictions, preventing deployment failures with ReservedResourceName or DomainNameLabelReserved errors.

The validation implements three types of restrictions based on Azure documentation[1]:

  1. Complete reserved words (40): Cannot be used as the exact cluster name
    Examples: ACCESS, AZURE, OFFICE, EXCHANGE, XBOX

    • "access" → rejected
    • "access1" → allowed (substring is OK)
  2. Substring forbidden (2): Cannot appear anywhere in the name
    MICROSOFT, WINDOWS

    • "amicrosoft-test" → rejected
    • "windows1" → rejected
  3. Prefix forbidden (1): Cannot be used at the start
    LOGIN

    • "login-cluster" → rejected
    • "bloginsystem" → allowed (not at start)

[1]https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-reserved-resource-name

gpei added 2 commits January 14, 2026 12:34
  Azure prohibits the use of certain reserved words and trademarks
  in resource names. This change adds validation to reject cluster
  names containing any of the 43 reserved words documented by Azure,
  preventing deployment failures with ReservedResourceName errors.

  Reserved words checked include:
  - Complete reserved words (40): AZURE, OFFICE, EXCHANGE, etc.
  - Substring forbidden (2): MICROSOFT, WINDOWS
  - Prefix forbidden (1): LOGIN
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 14, 2026
@openshift-ci-robot
Copy link
Contributor

@gpei: This pull request references Jira Issue OCPBUGS-66943, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Azure prohibits certain reserved words and trademarks in resource names that have accessible endpoints (such as FQDNs). This change adds validation to reject cluster names that violate Azure's reserved word restrictions, preventing deployment failures with ReservedResourceName or DomainNameLabelReserved errors.

The validation implements three types of restrictions based on Azure documentation[1]:

  1. Complete reserved words (40): Cannot be used as the exact cluster name
    Examples: ACCESS, AZURE, OFFICE, EXCHANGE, XBOX

    • "access" → rejected
    • "access1" → allowed (substring is OK)
  2. Substring forbidden (2): Cannot appear anywhere in the name
    MICROSOFT, WINDOWS

    • "amicrosoft-test" → rejected
    • "windows1" → rejected
  3. Prefix forbidden (1): Cannot be used at the start
    LOGIN

    • "login-cluster" → rejected
    • "bloginsystem" → allowed (not at start)

[1]https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-reserved-resource-name

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@gpei
Copy link
Contributor Author

gpei commented Jan 14, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 14, 2026
@openshift-ci-robot
Copy link
Contributor

@gpei: This pull request references Jira Issue OCPBUGS-66943, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jinyunma

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from jinyunma January 14, 2026 15:02
@gpei
Copy link
Contributor Author

gpei commented Jan 14, 2026

Some local test of the built installer

Cluster Name: login-test
# ./openshift-install create manifests --dir 0114
WARNING Release Image Architecture not detected. Release Image Architecture is unknown 
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: metadata.name: Invalid value: "login-test": cluster name must not start with the reserved word "login" 

Cluster Name: MICROSOFT
# ./openshift-install create manifests --dir 0114
WARNING Release Image Architecture not detected. Release Image Architecture is unknown 
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: [metadata.name: Invalid value: "MICROSOFT": cluster name must begin with a lower-case letter, metadata.name: Invalid value: "MICROSOFT": cluster name must not contain the reserved word "microsoft"] 

Cluster Name: azure
# ./openshift-install create manifests --dir 0114a
WARNING Release Image Architecture not detected. Release Image Architecture is unknown 
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: metadata.name: Invalid value: "azure": cluster name must not be the reserved word "azure" 

@gpei gpei changed the title OCPBUGS-66943: Validate cluster name against Azure reserved words WIP - OCPBUGS-66943: Validate cluster name against Azure reserved words Jan 14, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 14, 2026
@tthvo
Copy link
Member

tthvo commented Jan 14, 2026

/retest-required
/test e2e-azure-ovn

Copy link
Member

@tthvo tthvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2026
@patrickdillon
Copy link
Contributor

/approve

...but I'm not happy I can't name my cluster HOLOLENS!

@patrickdillon
Copy link
Contributor

patrickdillon commented Jan 14, 2026

/lgtm cancel

(Sorry for cancelling Thuan's lgtm, but it makes more sense than removing approve).

I just noticed that the commits need to be squashed. We can actually use tide to squash ALL the commits, and that would be fine in this case (but it doesn't work well if you have a PR where you want to preserve multiple commits).

If you want to use tide, that's fine we can re-add lgtm

Nice work on writing a good commit message

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 14, 2026
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2026
@gpei
Copy link
Contributor Author

gpei commented Jan 15, 2026

I just noticed that the commits need to be squashed. We can actually use tide to squash ALL the commits, and that would be fine in this case (but it doesn't work well if you have a PR where you want to preserve multiple commits).

@patrickdillon Thanks for letting me know about this. The last two commits are just fixes, so squashing them all is fine, we can just use Tide to squash the commits.

@gpei gpei changed the title WIP - OCPBUGS-66943: Validate cluster name against Azure reserved words OCPBUGS-66943: Validate cluster name against Azure reserved words Jan 15, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 15, 2026
@tthvo
Copy link
Member

tthvo commented Jan 15, 2026

/label tide/merge-method-squash

I think this is the right command for squashing 👀

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jan 15, 2026
@tthvo
Copy link
Member

tthvo commented Jan 15, 2026

/lgtm

Happy to reapply the lgtm 👍

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2026
@gpei
Copy link
Contributor Author

gpei commented Jan 15, 2026

Pre-merge verification done on this, the installer works as expected.
/verified by @gpei

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jan 15, 2026
@openshift-ci-robot
Copy link
Contributor

@gpei: This PR has been marked as verified by @gpei.

Details

In response to this:

Pre-merge verification done on this, the installer works as expected.
/verified by @gpei

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@gpei
Copy link
Contributor Author

gpei commented Jan 15, 2026

This should be a small enhancement that could be backported to 4.21. But I'm wondering about timing, with 4.21 about to GA soon and this not being a big issue (we already have docs warning against these reserved words), so should we backport now or wait for 4.21.z releases after GA?

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 15, 2026

@gpei: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 15d1d85 into openshift:main Jan 15, 2026
15 checks passed
@openshift-ci-robot
Copy link
Contributor

@gpei: Jira Issue Verification Checks: Jira Issue OCPBUGS-66943
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-66943 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

Azure prohibits certain reserved words and trademarks in resource names that have accessible endpoints (such as FQDNs). This change adds validation to reject cluster names that violate Azure's reserved word restrictions, preventing deployment failures with ReservedResourceName or DomainNameLabelReserved errors.

The validation implements three types of restrictions based on Azure documentation[1]:

  1. Complete reserved words (40): Cannot be used as the exact cluster name
    Examples: ACCESS, AZURE, OFFICE, EXCHANGE, XBOX

    • "access" → rejected
    • "access1" → allowed (substring is OK)
  2. Substring forbidden (2): Cannot appear anywhere in the name
    MICROSOFT, WINDOWS

    • "amicrosoft-test" → rejected
    • "windows1" → rejected
  3. Prefix forbidden (1): Cannot be used at the start
    LOGIN

    • "login-cluster" → rejected
    • "bloginsystem" → allowed (not at start)

[1]https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-reserved-resource-name

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@tthvo
Copy link
Member

tthvo commented Jan 15, 2026

This should be a small enhancement that could be backported to 4.21. But I'm wondering about timing, with 4.21 about to GA soon and this not being a big issue (we already have docs warning against these reserved words), so should we backport now or wait for 4.21.z releases after GA?

I guess the "bug" here is really a "user error" and we are helping to guard against it so it's a not a bug in the product that should block 4.21 GA. Looking at the criteria Patrick mentioned the other day, there is no attached customer case, and it's not critical so we can skip backporting it? But if we do, z-stream seems like a good place :D

What do you think Patrick?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants