mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #111189 from Octopusjust/k8s-pr4
Add testcases for cmd/kubeadm/app/util/net.go and version.go
This commit is contained in:
commit
5108b0a3a0
@ -44,6 +44,12 @@ func TestGetHostname(t *testing.T) {
|
|||||||
result: "overridden",
|
result: "overridden",
|
||||||
expectedErr: nil,
|
expectedErr: nil,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
desc: "hostname contains spaces",
|
||||||
|
hostname: " OVERRIDDEN ",
|
||||||
|
result: "overridden",
|
||||||
|
expectedErr: nil,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
desc: "hostname contains only spaces",
|
desc: "hostname contains only spaces",
|
||||||
hostname: " ",
|
hostname: " ",
|
||||||
|
@ -381,6 +381,11 @@ func TestKubeadmVersion(t *testing.T) {
|
|||||||
input: "v1.9",
|
input: "v1.9",
|
||||||
parsingError: true,
|
parsingError: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "invalid version with label and stray dot",
|
||||||
|
input: "v1.8.0-alpha.2.",
|
||||||
|
parsingError: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "invalid version with label and metadata",
|
name: "invalid version with label and metadata",
|
||||||
input: "v1.8.0-alpha.2.1231+afabd012389d53a",
|
input: "v1.8.0-alpha.2.1231+afabd012389d53a",
|
||||||
|
Loading…
Reference in New Issue
Block a user