-
Notifications
You must be signed in to change notification settings - Fork 77
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
CLOUDP-280230: Network peering translation layer #1884
base: main
Are you sure you want to change the base?
Conversation
Including fuzzing based conversion testing Signed-off-by: jose.vazquez <[email protected]>
78de4b3
to
23da286
Compare
VnetName: pointer.SetOrNil(peer.VNetName, ""), | ||
} | ||
default: | ||
panic(fmt.Errorf("unsupported provider %q", peer.ProviderName)) |
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.
i am sceptical this should panic 🤔 are we really considering this being a programmatic error?
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.
I am on the fence as well. There are 2 ways to hit this:
- Our validation fails to filter the provider name in the CRD.
- Atlas sends an incorrect value.
For the first one we could panic, is our fault. But for the second, I guess we should error out instead.
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.
@josvazg given this is driven by user input or Atlas responses I am in strong favor of returning an error.
A panic is valid if for we wire things incorrectly internally, i.e. use the "wrong indexer name" or something like that. But anything that arrives "via wire" from the user or Atlas to AKO shouldn't panic unless there are very very strong reasons.
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.
Our validation fails to filter the provider name in the CRD.
If we apply the rule I mentioned above this shouldn't panic as the provider name is returned from Atlas, aka it arrived externally to us.
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.
Atlas sends an incorrect value.
same rule as above. This is Atlas output, not an internal wiring error, it shouldn't panic.
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.
I will introduce an error return value and change all the code accordingly.
All Submissions: