You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/07/14 15:09:28 UTC

[GitHub] [trafficcontrol] ericholguin commented on a diff in pull request #6959: Make role name mutable

ericholguin commented on code in PR #6959:
URL: https://github.com/apache/trafficcontrol/pull/6959#discussion_r921267514


##########
lib/go-tc/roles.go:
##########
@@ -59,8 +59,9 @@ type RoleV40 struct {
 
 // Validate will validate and make sure all that the fields in the supplied RoleV4 struct are semantically correct.
 func (role RoleV4) Validate() error {
+	noSpaces := validation.NewStringRule(tovalidate.NoSpaces, "cannot contain spaces")
 	errs := validation.Errors{
-		"name":        validation.Validate(role.Name, validation.Required),
+		"name":        validation.Validate(role.Name, validation.Required, noSpaces),

Review Comment:
   Should that validation also be removed from TP?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org