mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Check length of instance name before truncating
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
parent
d45d803ac4
commit
c61b2a3975
@ -646,7 +646,10 @@ func (g *GCERunner) imageToInstanceName(imageConfig *internalGCEImage) string {
|
|||||||
// different machine types with the same image in parallel
|
// different machine types with the same image in parallel
|
||||||
name := imageConfig.machine + "-" + imageConfig.image + "-" + uuid.New().String()[:8]
|
name := imageConfig.machine + "-" + imageConfig.image + "-" + uuid.New().String()[:8]
|
||||||
// Sometimes the image is too long, we need instance names to have a max length of 63
|
// Sometimes the image is too long, we need instance names to have a max length of 63
|
||||||
|
if len(name) > 63 {
|
||||||
return name[:63]
|
return name[:63]
|
||||||
|
}
|
||||||
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GCERunner) registerGceHostIP(host string) error {
|
func (g *GCERunner) registerGceHostIP(host string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user