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
The deletion of a custom resource during a JUnit 5 test (which uses KubernetesMockServer) does not trigger any resource events which can be processed by a ResourceEventHandler. The custom resource has a finalizer set.
Fabric8 Kubernetes Client version
6.5.1
Steps to reproduce
Write a JUnit test which creates an modifies a custom resource. Emitted events are processed using a ResourceEventHandler.
Delete the custom resource using the KubernetesClient. The custom resource has a finalizer set.
No update or delete events will be caught in the ResourceEventHandler.
Getting the custom resource using the KubernetesClient shows that the deletionTimestamp has been set.
I attach the last log entry of the unit test. Please note that the bug only shows in tests, the deletion of the custom resource works fine in production code (i.e. there are emitted events to be processed).
Expected behavior
After the deletion an update event will be sent.
When I remove the finalizer a delete event will be sent.
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.24
Environment
Windows
Fabric8 Kubernetes Client Logs
[2023-03-31 18:04:26,014] [INFO] [MockWebServer /127.0.0.1:57355] [{}] [okhttp3.mockwebserver.MockWebServer] - MockWebServer[57316] received request: DELETE /apis/acme.com/v1/namespaces/acme/databaseschemas/db-schema-delete HTTP/1.1 and responded: HTTP/1.1 200 OK
Additional context
No response
The text was updated successfully, but these errors were encountered:
I think this is because the finalizer handling logic is not incrementing the resourceVersion, so the informer logic does not know the resource has changed.
The state of the resource after the mock server has finished processing it is: resourceVersion is null, finalizers is empty.
Since I do not control the resourceVersion, I assume that this is a bug in the mock server.
Describe the bug
The deletion of a custom resource during a JUnit 5 test (which uses KubernetesMockServer) does not trigger any resource events which can be processed by a ResourceEventHandler. The custom resource has a finalizer set.
Fabric8 Kubernetes Client version
6.5.1
Steps to reproduce
I attach the last log entry of the unit test. Please note that the bug only shows in tests, the deletion of the custom resource works fine in production code (i.e. there are emitted events to be processed).
Expected behavior
After the deletion an update event will be sent.
When I remove the finalizer a delete event will be sent.
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.24
Environment
Windows
Fabric8 Kubernetes Client Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: