k3s/pkg/util
Kubernetes Submit Queue cb1ef9f7e8
Merge pull request #64815 from dixudx/hostname_empty
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

error out empty hostname

**What this PR does / why we need it**:
For linux, the hostname is read from file `/proc/sys/kernel/hostname` directly, which can be overwritten with whitespaces.

Should error out such invalid hostnames.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#835

**Special notes for your reviewer**:
/cc luxas timothysc 

**Release note**:

```release-note
nodes: improve handling of erroneous host names
```
2018-08-03 17:13:32 -07:00
..
async Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
bandwidth Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
config Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
configz set right Content-Type for configz 2018-03-29 16:07:47 +08:00
conntrack Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
dbus Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
ebtables Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
env Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
file Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
filesystem unpack dynamic kubelet config payloads to files 2018-04-19 09:18:53 -07:00
flag Log the command line flags 2018-02-15 18:04:04 -05:00
flock Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
goroutinemap Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
hash Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
initsystem Add a 'kubeadm upgrade node config' command and finish up the kubelet integration work 2018-06-06 23:17:04 +03:00
interrupt update BUILD files 2017-10-15 18:18:13 -07:00
io Remove unused io util writer & volume host GetWriter() 2018-07-09 14:09:48 -07:00
ipconfig Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
ipset when hashsize is Invalid, add an error log 2018-07-25 12:01:34 +08:00
iptables Avoid allocations when parsing iptables 2018-07-08 10:55:19 +02:00
ipvs Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
keymutex Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
labels Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
limitwriter Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
maps update BUILD files 2017-10-15 18:18:13 -07:00
metrics Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
mount Fix unit test failure: TestNsenterExistsFile 2018-08-02 00:01:53 +08:00
net Auto-updated BUILD files 2018-02-27 11:18:11 -08:00
netsh Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
node nodes: improve handling of erroneous host names 2018-08-01 14:57:25 +08:00
normalizer Clone documentation utility from //pkg/kubectl/cmd/templates 2017-11-16 10:18:00 +01:00
nsenter Implement fixes for flexvolume when kubelet is contanerized 2018-07-03 14:04:52 -04:00
oom Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
parsers Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
pod Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
procfs Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
reflector/prometheus Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
removeall Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
resizefs Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
resourcecontainer Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
rlimit Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
selinux Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
slice Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
strings Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
sysctl update BUILD files 2017-10-15 18:18:13 -07:00
system Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
tail Merge pull request #59713 from hanxiaoshuai/fix0211 2018-02-22 23:17:38 -08:00
taints Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
template Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
term Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
threading Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
tolerations Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
version Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
workqueue/prometheus Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
BUILD auto-generated file 2018-07-28 07:54:17 +08:00
verify-util-pkg.sh Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00