Skip to content

Commit 5d06ff7

Browse files
authored
Merge pull request #18 from threefoldtech/add-validation-to-workload-name-length
add validation to workload name length
2 parents 78ce6f4 + 2cb1b0d commit 5d06ff7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/gridtypes/id.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ func IsValidName(n Name) error {
8080
return fmt.Errorf("name cannot be empty")
8181
}
8282

83+
// this because max virtio fs tag length is 36 and it is used by cloud-hypervisor
84+
if len(n) > 36 {
85+
return fmt.Errorf("name cannot exceed 36 characters")
86+
}
87+
8388
if !nameMatch.MatchString(string(n)) {
8489
return fmt.Errorf("unsupported character in workload name")
8590
}

0 commit comments

Comments
 (0)