Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Ensure finalizer is removed when 409 Conflict returned on status update #2078

Merged
merged 2 commits into from
Jun 11, 2018

Conversation

luksa
Copy link
Contributor

@luksa luksa commented May 30, 2018

Fixes #2066

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 30, 2018
@MHBauer MHBauer added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 31, 2018
@luksa luksa force-pushed the fix_finalizer_removal branch 3 times, most recently from e04e5f0 to 1f5a5ae Compare May 31, 2018 13:00
@jboyd01 jboyd01 removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 31, 2018

func (c *controller) updateServiceInstanceStatusWithRetries(
instance *v1beta1.ServiceInstance,
updateFunc func(*v1beta1.ServiceInstance)) (*v1beta1.ServiceInstance, error) {
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@carolynvs carolynvs left a 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) {
Copy link
Contributor

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.

@carolynvs carolynvs added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 8, 2018
@luksa luksa force-pushed the fix_finalizer_removal branch from e57ce63 to addf226 Compare June 11, 2018 12:01
Copy link
Contributor

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

LGTM

@carolynvs carolynvs merged commit c1adcfe into kubernetes-retired:master Jun 11, 2018
kikisdeliveryservice pushed a commit to kikisdeliveryservice/service-catalog that referenced this pull request Jun 29, 2018
…te (kubernetes-retired#2078)

* Ensure finalizer is removed when 409 Conflict returned on status update

* Improve naming & add documentation to updateServiceInstanceStatusWithRetries
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. LGTM1 LGTM2 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants