Skip to content
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

Add idprefix validation #260

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

bailinhe
Copy link
Contributor

@bailinhe bailinhe commented Jun 5, 2024

Add idprefix validation on IAPL validate

Signed-off-by: Bailin He <[email protected]>
@bailinhe bailinhe marked this pull request as ready for review June 5, 2024 20:10
@bailinhe bailinhe requested review from a team as code owners June 5, 2024 20:10
Signed-off-by: Bailin He <[email protected]>
Comment on lines 297 to 299
if _, err := gidx.NewID(rr.IDPrefix); err != nil {
return fmt.Errorf("%s: relationships: %s: %w", resourceType.Name, tt.Name, err)
}
Copy link
Contributor

@mikemrm mikemrm Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be testing the prefix on every related resource type instead of just the individual resource type. If a resource was created with no other resources relating to it, it's idprefix would not be checked.

I believe using resourceType from line 289 might be the proper place to do that validation.

Signed-off-by: Bailin He <[email protected]>
@bailinhe bailinhe merged commit 53c0413 into infratographer:main Jun 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants