Skip to content

Commit

Permalink
Merge pull request #1109 from ioito/hotfix/qx-gcp-disk-name-length
Browse files Browse the repository at this point in the history
fix(gcp): validate gcp disk name length
  • Loading branch information
ioito authored Nov 7, 2024
2 parents 863ef87 + 35d4278 commit cdd0d15
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 @@ -574,7 +574,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 cdd0d15

Please sign in to comment.