-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Describe the bug
In kubernetes 1.33 (probably if feature "emulation-version" was enabled), k8s-host/version returns additional fields which breaks JSON-parsing
Client Version
e.g. 23.0.0
Kubernetes Version
e.g. 1.33
Java Version
e.g. Java 17
To Reproduce
Try the following code with server k8s 1.33
"""
CoreV1Api coreV1Api = kubeClientBuilder.getCoreV1Api(kubeConfigFile.toString());
String kubernetesVersion = new VersionApi(coreV1Api.getApiClient()).getCode().execute().getGitVersion();
"""
Expected behavior
To get version of kubernetes in format "1.33" or something similar
KubeConfig
If applicable, add a KubeConfig file with secrets redacted.
Server (please complete the following information):
- OS: Linux
- Environment container
- Cloud - any platform
Additional context
It looks like in scope of this issue and commit provided below "/version" endpoint response has changed. Basically few additional fields were added:
kubernetes/kubernetes#129969
https://github.com/kubernetes/kubernetes/pull/130019/commits
Error:
An error occurred during validating cluster config: The field emulationMajor
in the JSON string is not defined in the VersionInfo
properties. JSON:
{"major":"1","minor":"33","emulationMajor":"1","emulationMinor":"33","minCompatibilityMajor":"1","minCompatibilityMinor":"32","gitVersion":"v1.33.0","gitCommit":"65f3ebc02e1db418b0375a4c71c315e12b637b5b","gitTreeState":"clean","buildDate":"2025-05-02T08:36:13Z","goVersion":"go1.24.2","compiler":"gc","platform":"linux/amd64"}
We understand that currently kubernetes java library doesn't support k8s 1.33. Couple of questions:
- Could you please help at which version the support of k8s 1.33 is planned
- To highlight issue we faced and see if the fix is going to be a part of next release
- Is it possible to provide patch-version of library for that specific issue?