Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate cluster name using RFC 1123 regexp #1648

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Nov 29, 2021

What this PR does / why we need it:

#1641 introduced validation for the cluster name to fix #1630. However, the regexp used in that PR is too restrictive because it doesn't allow dots, which are allowed by RFC 1123. Also, the original implementation doesn't cover other requirements defined by RFC 1123:

  • contain no more than 253 characters
  • start with an alphanumeric character
  • end with an alphanumeric character

This PR uses the regexp used by Kubernetes to validate RFC 1123 subdomains.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
xref #1630

Does this PR introduce a user-facing change?:

Validate cluster name using RFC 1123 regexp

/assign @kron4eg @ahmedwaleedmalik

@kubermatic-bot kubermatic-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 29, 2021
@kubermatic-bot kubermatic-bot added dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 29, 2021
Copy link
Member

@ahmedwaleedmalik ahmedwaleedmalik left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 29, 2021
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9e3f6c80b1130a2f6cb25c608c0e13cc970e14f4

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmedwaleedmalik, xmudrii

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

The pull request process is described here

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

@kubermatic-bot kubermatic-bot merged commit 6c151a6 into master Nov 29, 2021
@kubermatic-bot kubermatic-bot added this to the KubeOne 1.4 milestone Nov 29, 2021
@kubermatic-bot kubermatic-bot deleted the cluster-name-rfc1123 branch November 29, 2021 10:43
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. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid creating resources with uppercase names by validating the inputs
4 participants