-
Notifications
You must be signed in to change notification settings - Fork 382
Ensure finalizer is removed when 409 Conflict returned on status update #2078
Ensure finalizer is removed when 409 Conflict returned on status update #2078
Conversation
e04e5f0
to
1f5a5ae
Compare
|
||
func (c *controller) updateServiceInstanceStatusWithRetries( | ||
instance *v1beta1.ServiceInstance, | ||
updateFunc func(*v1beta1.ServiceInstance)) (*v1beta1.ServiceInstance, 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'd certainly benefit from a comment on this function indicating the updateFunc (if specified) applies additional updates to the instance which must be applied in the event this instance is out of date and an updated instance must be used.
LGTM though.
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.
Agreed, this really needs more explanation and perhaps a different name? If I understand this properly the function is applied only when retrying after an conflict, a more clear name would perhaps be resolveConflictFunc
or something along those lines.
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've added a comment & renamed the function to postConflictUpdateFunc
.
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.
Just one small clarification is needed, looks good otherwise.
|
||
func (c *controller) updateServiceInstanceStatusWithRetries( | ||
instance *v1beta1.ServiceInstance, | ||
updateFunc func(*v1beta1.ServiceInstance)) (*v1beta1.ServiceInstance, 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.
Agreed, this really needs more explanation and perhaps a different name? If I understand this properly the function is applied only when retrying after an conflict, a more clear name would perhaps be resolveConflictFunc
or something along those lines.
e57ce63
to
addf226
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.
LGTM
…te (kubernetes-retired#2078) * Ensure finalizer is removed when 409 Conflict returned on status update * Improve naming & add documentation to updateServiceInstanceStatusWithRetries
Fixes #2066