Unified Storage: KVStore use new validation (#110834)
* name field must match either k8s regex or grafana legacy uid regex. Adds tests. * moves invalid test to being valid * uses new US naming validation for kv store validation * fix function name and update key regex * fix comment * use correct errs var * updates kv key tests
This commit is contained in:
@@ -554,7 +554,7 @@ func (s *server) newEvent(ctx context.Context, user claims.AuthInfo, key *resour
|
||||
return nil, NewBadRequestError(
|
||||
fmt.Sprintf("key/name do not match (key: %s, name: %s)", key.Name, obj.GetName()))
|
||||
}
|
||||
if errs := validation.IsValidGrafanaName(obj.GetName()); err != nil {
|
||||
if errs := validation.IsValidGrafanaName(obj.GetName()); errs != nil {
|
||||
return nil, NewBadRequestError(errs[0])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user