kubernetes: e2e test host_processs.go failed when the hostname is greater then 15 characters.

What happened?

I want to run the host_process.go e2e test but it failed.

Reason: Node name and hostname is longer than 15 characters. But the ComputerName only used the first 15 characters. So they don’t equal and the test failed.

What did you expect to happen?

The e2etest should pass regardless of the hostname length.

How can we reproduce it (as minimally and precisely as possible)?

Deploy a Windows with long nodename (longer than 15 characters). Then, run host_process.go e2e test.

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
# paste output here
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3+vmware.1", GitCommit:"1e08ca8eda6b74527882c9baee8e05620d24c96a", GitTreeState:"clean",
 BuildDate:"2021-11-01T20:55:58Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"windows/amd64"}  

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
BuildNumber  Caption                                 OSArchitecture  Version                                                                                  
17763        Microsoft Windows Server 2019 Standard  64-bit          10.0.17763

Install tools

Container runtime (CRI) and and version (if applicable)

Related plugins (CNI, CSI, …) and versions (if applicable)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments

We discussed this a bit on slack, the test is using %COMPUTERNAME% to validate we are running on the host. This value is truncated to 15 chars on windows due to netbios. We could use the hostname, which isn’t truncated, with a fallback to computer name for this validation to make the test validate more scenarios.

Important to note that some scenarios might not work if in older environments that use netbios but for our test purposes this will work. Long discussion on netbios here: https://github.com/kubernetes-sigs/cluster-api/issues/2217