-
Notifications
You must be signed in to change notification settings - Fork 2k
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
dynamic host volumes: create/register RPC validation #24482
base: dynamic-host-volumes
Are you sure you want to change the base?
Conversation
788faa7
to
8b5f3d0
Compare
8b5f3d0
to
b0c16b2
Compare
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.
looks great!
The `HostVolumeByID` state store method didn't add a watch channel to the watchset, which meant that it would never unblock. The tests missed this because they were racy, so move the updates for unblocking tests into a `time.After` call to ensure the queries are blocked before the update happens.
Add several validation steps in the create/register RPCs for dynamic host volumes. We first check that submitted volumes are self-consistent (ex. max capacity is more than min capacity), then that any updates we've made are valid. And we validate against state: preventing claimed volumes from being updated and preventing placement requests for nodes that don't exist. Ref: #15489
bf4da7d
to
d8cb133
Compare
func FlattenMultierror(err error) error { | ||
if err == nil { | ||
return nil | ||
} | ||
mErr := err.(*multierror.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 would conditionally type cast this, so a standard error
could be passed in, and just returned right away. then the extra if mErr == nil
check below seems superfluous given this new nil check up top, eh?
Add several validation steps in the create/register RPCs for dynamic host volumes. We first check that submitted volumes are self-consistent (ex. max capacity is more than min capacity), then that any updates we've made are valid. And we validate against state: preventing claimed volumes from being updated and preventing placement requests for nodes that don't exist.
Ref: #15489