kubernetes-client / java

Official Java client library for kubernetes
http://kubernetes.io/
Apache License 2.0
3.59k stars 1.92k forks source link

Examples for `CoreV1Api.listNamespacedPod()` is incorrect for version 20 and beyond of the client #3575

Open bcarld opened 4 months ago

bcarld commented 4 months ago

Describe the bug Client version 20.0.1 and beyond changed the signature for all of the CoreV1Api.list* by removing all of the parameters that allow selectors, but the release notes to do provide guidance on how to filter the list. After various web searches, I went to java doc and it does not provide any info (not too surprising since the javadoc is method specfic). I then went to the examples and found and example. But, it is older as it has all of the old parameters.

For compatibility breaking changes, it would be nice to have better documentation in the release notes with the recommended new method to do what the previous method can no longer do due to the reduction of parameters.

Client Version 20.0.1

Kubernetes Version e.g. 1.19.3

Java Version e.g. Java 8

To Reproduce Change 'io.kubernetes:client-java:19.0.1' to 'io.kubernetes:client-java:20.0.1' or later and try to build.

Expected behavior

Additional context My problem is a build break due to moving up versions to resolve a security vulnerability in one of the packages used by the java client.

bcarld commented 4 months ago

I was looking at this code example -- https://github.com/kubernetes-client/java/wiki/3.-Code-Examples I was looking at this java doc -- https://javadoc.io/static/io.kubernetes/client-java-api/20.0.1/io/kubernetes/client/openapi/apis/CoreV1Api.html#listNamespacedPod(java.lang.String) I found the compatibility breakage notice in this README -- https://github.com/kubernetes-client/java/blob/master/README.md

brendandburns commented 4 months ago

Thanks for pointing that out, we should probably just delete those examples from the wiki, the up to date examples are here:

https://github.com/kubernetes-client/java/tree/master/examples/examples-release-20

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 days ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten