You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kubernetes API doesn't apply the merge-patch+json patch but responds 200 OK
leads to bugs and confusion, when testing operators.
With this change, kopf will check, if the merge-patch+json patch was merged and be verbose, if the patch was not exactly successful.
Description
Before: When a patch wasn't merged, then kopf didn't report anything.
After: When a patch wasn't merged, then kopf will report if ran in --verbose mode.
This will help users to debug their operators. Especially, when they use OpenAPI schemas in their CRDs.
Not sure if the check is in the right place and the logger is setup appropriately.
No risky changes.
Issues/PRs
If a patch is not merged, then it is usually because of a schema mismatch of the CRD. For this reason it was discussed to move the internal kopf status to the annotations. #308#321
Type of changes
Bug fix (non-breaking change which fixes an issue)
Checklist
The code addresses only the mentioned problem, and this problem only
I think the code is well written
Unit tests for the changes exist
Documentation reflects the changes
If you provide code modification, please add yourself to CONTRIBUTORS.txt
Thx for all the comments and suggestions. Had to add quite a bit of code. I think quality is OK and changes are safe.
Missing is integration tests with the Kubernetes API responses, and especially integration tests with the status_patch merging. What I did was based of an educated guess from reviewing https://github.com/kubernetes/apiextensions-apiserver. If we wanted to be 100% safe, we would also have to test the PATCH API of the canonical Kubernetes objects.
The text was updated successfully, but these errors were encountered:
Reimplemented in #527 based on the original solution in this PR, but with a different approach to comparison (via diffs instead of own implementation of patching, which can mismatch with K8s's implementation).
What do these changes do?
The situation
merge-patch+json
patchmerge-patch+json
patch but responds200 OK
leads to bugs and confusion, when testing operators.
With this change, kopf will check, if the
merge-patch+json
patch was merged and be verbose, if the patch was not exactly successful.Description
Before: When a patch wasn't merged, then kopf didn't report anything.
After: When a patch wasn't merged, then kopf will report if ran in
--verbose
mode.This will help users to debug their operators. Especially, when they use OpenAPI schemas in their CRDs.
Not sure if the check is in the right place and the logger is setup appropriately.
No risky changes.
Issues/PRs
If a patch is not merged, then it is usually because of a schema mismatch of the CRD. For this reason it was discussed to move the internal kopf
status
to the annotations. #308 #321Type of changes
Checklist
CONTRIBUTORS.txt
Thx for all the comments and suggestions. Had to add quite a bit of code. I think quality is OK and changes are safe.
Missing is integration tests with the Kubernetes API responses, and especially integration tests with the
status_patch
merging. What I did was based of an educated guess from reviewing https://github.com/kubernetes/apiextensions-apiserver. If we wanted to be 100% safe, we would also have to test thePATCH
API of the canonical Kubernetes objects.The text was updated successfully, but these errors were encountered: