Skip to content

Commit

Permalink
add validation to workload name length
Browse files Browse the repository at this point in the history
  • Loading branch information
Eslam-Nawara committed Oct 20, 2024
1 parent 78ce6f4 commit 2cb1b0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/gridtypes/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ func IsValidName(n Name) error {
return fmt.Errorf("name cannot be empty")
}

// this because max virtio fs tag length is 36 and it is used by cloud-hypervisor
if len(n) > 36 {
return fmt.Errorf("name cannot exceed 36 characters")
}

if !nameMatch.MatchString(string(n)) {
return fmt.Errorf("unsupported character in workload name")
}
Expand Down

0 comments on commit 2cb1b0d

Please sign in to comment.