Skip to content

Commit

Permalink
Merge pull request #1111 from ioito/automated-cherry-pick-of-#1109-up…
Browse files Browse the repository at this point in the history
…stream-release-3.11

Automated cherry pick of #1109: fix(gcp): validate gcp disk name length
  • Loading branch information
ioito authored Nov 7, 2024
2 parents 022c612 + 756cdb7 commit 12e4e04
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/multicloud/google/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,14 @@ func (region *SRegion) _createVM(zone string, desc *cloudprovider.SManagedVMCrea
nameConv := func(name string) string {
name = strings.Replace(name, "_", "-", -1)
name = pinyinutils.Text2Pinyin(name)
return strings.ToLower(name)
name = strings.ToLower(name)
if len(name) > 63 {
name = name[:63]
}
if name[len(name)-1] == '-' {
name = name[:len(name)-1] + "1"
}
return name
}

labels := map[string]string{}
Expand Down

0 comments on commit 12e4e04

Please sign in to comment.