-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make sure no resource has the same id for capability type #12
Conversation
b486437
to
a2b4762
Compare
pkg/validation/validation.go
Outdated
unitIds := make(map[string]struct{}) | ||
units := core.GetResourcesOfType[T](result) | ||
for _, unit := range units { | ||
fmt.Println(unit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Println(unit) |
pkg/validation/validation.go
Outdated
for _, unit := range units { | ||
fmt.Println(unit) | ||
if id, ok := unitIds[unit.Key().Name]; ok { | ||
return fmt.Errorf("Multiple Persist objects with the same name, '%s'", id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't id
be a struct{}{}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah, meant to swithc that and log name. will update
|
fyi, this works, i needed to rebase from main locally because the bug from a couple days ago was still affecting this finding the persist annotations to begin with |
• Does any part of it require special attention?
• Does it relate to or fix any issue? closes #635
For now this only really will ever catch persist since no other resource type has multiple kinds, but checking them anyways in case they ever do.
Standard checks