vSphere credentials Secret creation fails if VSPHERE_SERVER
contains a trailing slash
#3473
Labels
kind/bug
Categorizes issue or PR as related to a bug.
sig/cluster-management
Denotes a PR or issue as being assigned to SIG Cluster Management.
triage/needs-information
Indicates an issue needs more information in order to work on it.
What happened?
If
VSPHERE_SERVER
environment variable contains a trailing slash, creating vSphere credentials Secret fails because/
is not an allowed character in a key name.The key names in the vSphere credentials Secret are using the pattern of
{{ .VSPHERE_SERVER }}.{{ .username}}
and{{ .VSPHERE_SERVER }}.{{ .password}}
. IfVSPHERE_SERVER
has a trailing slash, the generated key name would be<server>/.username
which is not allowed by Kubernetes.kubeone/pkg/credentials/secret.go
Lines 213 to 218 in e43259a
Expected behavior
There are two possible options:
VSPHERE_SERVER
values that have a trailing slashHow to reproduce the issue?
VSPHERE_SERVER
environment variable to a value that contains a trailing slashWhat cloud provider are you running on?
vSphere
Additional information
This code might have another bug. We drop
https://
prefix, but nothttp://
, which might be a valid prefix too (we should verify that).The text was updated successfully, but these errors were encountered: