Skip to content

Commit

Permalink
fix remote cm name
Browse files Browse the repository at this point in the history
  • Loading branch information
aleoli authored and fra98 committed Jul 2, 2024
1 parent 25134cd commit 8c58ba8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/virtualKubelet/forge/configmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ func LocalConfigMapName(remote string) string {
// RemoteConfigMapName forges the name for the reflected configmap, remapping the one of the root CA to prevent collisions.
func RemoteConfigMapName(local string) string {
if local == RootCAConfigMapName {
name := RootCAConfigMapName + "." + string(LocalCluster)[0:5]
var suffix string
if len(LocalCluster) > 5 {
suffix = string(LocalCluster)[0:5]
} else {
suffix = string(LocalCluster)
}
name := RootCAConfigMapName + "." + suffix
// if the last character is not alphanumeric, we add a random alphanumeric character to avoid issues with k8s
if !isAlphanumeric(name[len(name)-1]) {
name += "a"
Expand Down

0 comments on commit 8c58ba8

Please sign in to comment.