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

Avoid unnecessary patching when resources are being deleted #9763

Merged
merged 1 commit into from Mar 4, 2024

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Mar 1, 2024

Type of change

  • Bugfix

Description

Currently, when diffing Kubernetes resources we do not ignore the deletion timestamp and the deletion grace period. As a result, we might patch a Kubernetes resource that is being deleted because these two fields trigger a diff. To avoid this, this adds them to the ignore lists.

One of the examples where this might cause a problem is when you delete a PVC -> it should not be deleted while being used by a pod. But because the operator patches the resource, it removes the finalizer and gets it deleted while still in use. In some environment, that seems to also wipe the PV and the data volume and fail the pod. In others, it seems the PV deletion will not happen until the pod rolls. But none of the cases is desired and this PR should mitigate it (the only other solution to deal with it even better in the future is using server-side-apply).

Checklist

  • Make sure all tests pass
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj scholzj added this to the 0.40.0 milestone Mar 1, 2024
@scholzj scholzj requested a review from ppatierno March 1, 2024 16:52
@scholzj
Copy link
Member Author

scholzj commented Mar 2, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj merged commit 0c3deb1 into strimzi:main Mar 4, 2024
21 checks passed
@scholzj scholzj deleted the deal-better-with-resource-deletion branch March 4, 2024 15:42
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.

None yet

3 participants