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:
owensmallwood
2025-10-09 11:25:39 -06:00
committed by GitHub
parent 4d3c5d1550
commit 1f7f3c9a5a
10 changed files with 502 additions and 291 deletions
+1 -1
View File
@@ -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])
}