mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
force node name in generated static pod name lowercase
This commit is contained in:
parent
fb5caac2da
commit
a331f818ff
@ -21,6 +21,7 @@ import (
|
|||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -44,7 +45,7 @@ import (
|
|||||||
|
|
||||||
// Generate a pod name that is unique among nodes by appending the nodeName.
|
// Generate a pod name that is unique among nodes by appending the nodeName.
|
||||||
func generatePodName(name string, nodeName types.NodeName) string {
|
func generatePodName(name string, nodeName types.NodeName) string {
|
||||||
return fmt.Sprintf("%s-%s", name, nodeName)
|
return fmt.Sprintf("%s-%s", name, strings.ToLower(string(nodeName)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyDefaults(pod *api.Pod, source string, isFile bool, nodeName types.NodeName) error {
|
func applyDefaults(pod *api.Pod, source string, isFile bool, nodeName types.NodeName) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user