generated from TrueCloudLab/basic
schema: Add resource name validation method #27
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-services-developers
Labels
No labels
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/policy-engine#27
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/policy-engine:feature/26-resource_validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #26
Signed-off-by: Airat Arifullin aarifullin@yadro.com
edf9efcd03
to07a8a3b0f3
07a8a3b0f3
to20f23004af
@ -0,0 +35,4 @@
return true
}
func IsNativeResourceNameValid(resource string) bool {
Validation method is nice, but can we also describe this somewhere in docs?
Also, what about a benchmark? There are some opportunities for an optimization.
I've added
docs
where I also describe what is a resource from the APE point. Waiting for your comments and notes :)I've also added a benchmark test
20f23004af
to0c104e90e4
@ -0,0 +4,4 @@
This can be an object in a container within a namespace, or all objects in a container,
or all containers within the root namespace etc.
A resource can be viewed from two sides:
The idea is not fully unfolded, but I suggest to give more details when we will describe the chain router
@ -0,0 +89,4 @@
func BenchmarkIsNativeResourceNameValid(b *testing.B) {
for _, test := range tests {
b.Run(test.name, func(b *testing.B) {
for i := 0; i < 2000; i++ {
Why
2000
, notb.N
?Fixed!
0c104e90e4
toe4e381b8a4