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
conntrack Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
dbus
ebtables
env
file
filesystem unpack dynamic kubelet config payloads to files 2018-04-19 09:18:53 -07:00
flag
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
initsystem Add a 'kubeadm upgrade node config' command and finish up the kubelet integration work 2018-06-06 23:17:04 +03:00
interrupt
io Remove unused io util writer & volume host GetWriter() 2018-07-09 14:09:48 -07:00
ipconfig
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
labels Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
limitwriter
maps
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
netsh
node nodes: improve handling of erroneous host names 2018-08-01 14:57:25 +08:00
normalizer
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
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
sysctl
system Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
tail
taints Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
template
term Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
threading
tolerations
version
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