Open agustin-munoz opened 6 months ago
/cc @geoand (kubernetes,openshift), @iocanel (kubernetes,openshift)
cc @manusa
I've had a browse around this issue, unless I've got the wrong end of the stick it is coming from the fabric8 library and this particular feature has been requested but not yet implemented: https://github.com/fabric8io/kubernetes-client/issues/4113
In that thread its suggested that this alternative would cover the use case: Kube API test module @agustin-munoz would that help you get your desired tests working?
We've discussed this multiple times on the Fabric8 side. There's a limit to the number of features we can add to the Kubernetes Moc kServer until we've completely re-implemented the Kuberentes API and its workers. The recommendation for more advanced use caes is to either use Dev Services with a Kind cluster or similar, or the newly added Kube API test module as @Dairdevil suggests.
Unfortunately there's been an issue with the release pipelines and the Kube API server hasn't been released yet. However, we're working on its release (https://github.com/fabric8io/kubernetes-client/issues/5898) ASAP.
Thanks @Dairdevil and @manusa, that for sure will help.
Describe the bug
When doing unit tests using the Kubernetes/Openshift server use of matchExpressions is not working properly
Expected behavior
Get the mathing namespaces
Actual behavior
Seems like it is just ignoring the matchExpressions
How to Reproduce?
Use this test, there will be 2 fails because MatchExpressions are not handled well by the mock server, in the code is commented right after the failing test the query sent to api. Using this same query against a real kubernetes or openshift API returns the right namespaces.
Output of
uname -a
orver
Linux workhorse 5.15.0-100-generic #110-Ubuntu SMP Wed Feb 7 13:27:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
java version "17.0.5" 2022-10-18 LTS Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191) Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)
Quarkus version or git rev
3.8.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Additional information
I've tried also with quarkus 3.2.10.Final, and found same issue.