You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As playground currently does not work here the example code.
// You can edit this code!
// Click here and start typing.
package main
import (
"fmt"
"strings"
)
func getShortname(hostname string) (string, error) {
if len(hostname) == 0 {
return "", fmt.Errorf("unable to find shortname from %s as len is 0 %d", hostname, len(hostname))
}
hostParts := strings.Split(hostname, ".")
if len(hostParts) >= 1 {
return hostParts[0], nil
}
return "", fmt.Errorf("unable to find shortname from %s, as hostParts are %v", hostname, hostParts)
}
func main() {
fmt.Println(getShortname("wuerfelchen-w-1"))
}
The text was updated successfully, but these errors were encountered:
Cellebyte
changed the title
[Bug] shortName not correctly discoverd
[Bug] shortName not correctly discovered
Jan 13, 2024
kube-vip/pkg/manager/watch_endpoints.go
Line 241 in 3c0e5e3
This should be
>=
so short host names also work.As playground currently does not work here the example code.
The text was updated successfully, but these errors were encountered: