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

Allow hosts with hyphen in name #6529

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

floryut
Copy link
Member

@floryut floryut commented Aug 13, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
Hostname with hyphen should be allowed

Which issue(s) this PR fixes:
Fixes #6509

Special notes for your reviewer:
Tests ok

[floryut@lkubedev inventory_builder ] $ pytest
============================= test session starts =============================
platform linux -- Python 3.6.8, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/floryut/inventory_builder
collected 29 items

tests/test_inventory.py .............................[100%]

============================= 29 passed in 0.15s ==============================

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 13, 2020
@k8s-ci-robot k8s-ci-robot requested review from bozzo and EppO August 13, 2020 12:21
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 13, 2020
@oomichi
Copy link
Contributor

oomichi commented Aug 13, 2020

confirmed this PR works fine on my local env.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 13, 2020
@@ -238,7 +238,7 @@ def ips(start_address, end_address):
return [ip_address(ip).exploded for ip in range(start, end + 1)]

for host in hosts:
if '-' in host and not host.startswith('-'):
if '-' in host and not (host.startswith('-') or host[0].isalpha()):
Copy link
Contributor

Choose a reason for hiding this comment

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

Took me some time to figure out that if the first char is a letter, it has to be a host, not a range. This is okay

@mattymo
Copy link
Contributor

mattymo commented Aug 18, 2020

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, mattymo

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit 73b2683 into kubernetes-sigs:master Aug 18, 2020
erulabs added a commit to kubesail/kubespray that referenced this pull request Aug 18, 2020
* 'master' of https://github.com/kubernetes-sigs/kubespray:
  Allow hosts with hyphen in name (kubernetes-sigs#6529)
  Update apiserver-audit-policy.yaml.j2 (kubernetes-sigs#6526)
  add master_volume_type variable (kubernetes-sigs#6524)
  Remove unused variable (kubernetes-sigs#6522)
  Add new cilium options for native routing (kubernetes-sigs#6519)
  Fixed Kubespray container-engine/docker role to populate docker.service (kubernetes-sigs#6518)
  Fix cilium_deploy_additionally with kubeadm etcd (kubernetes-sigs#6514)
  improve Cilium metrics support (kubernetes-sigs#6513)
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jan 10, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hosts.yaml generation fails if node host name contains hyphen character
4 participants