Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while listing services in kubernetes version 1.30.1 #3784

Open
prateekkohli21 opened this issue Nov 7, 2024 · 1 comment
Open

Error while listing services in kubernetes version 1.30.1 #3784

prateekkohli21 opened this issue Nov 7, 2024 · 1 comment

Comments

@prateekkohli21
Copy link

Describe the bug
I am getting below error while listing services in kubernetes version 1.30.1 and client version 20.0.1

Exception : java.lang.IllegalArgumentException: The field ipMode in the JSON string is not defined in the V1LoadBalancerIngress properties. JSON: {"ip":"10.217.127.235","ipMode":"VIP"}","extra_data":{"licensehandler":{"log_plane":"em-containerlogs"}},"metadata":{"properties":{"ul_id":"com.licensehandler.kubernetes.manager","pod_name":"abc-7fd8c957cd-vxdpd"}}}

Client Version
e.g. 20.0.1

Kubernetes Version
e.g. 1.30.1

Java Version
e.g. Java 11

To Reproduce
Steps to reproduce the behavior:

trying to list services using below code:
V1ServiceList serviceList = coreV1Api.listNamespacedService(namespace).execute();

    if(serviceList != null) {
        List<V1Service> filteredServices = serviceList.getItems().stream()
                .filter(service -> hasMatchingServiceAnnotations(service, annotations))
                .collect(Collectors.toList());

Expected behavior
Although the compatibility matrix shows "-" in this scenario, but still is there any way we can handle such incompatibility scenarios?

KubeConfig
If applicable, add a KubeConfig file with secrets redacted.

Server (please complete the following information):

  • OS: Linux
  • Environment-Container
  • Cloud: On-prem

Additional context

The issue arises because ipMode is not recognized as a defined property in the V1LoadBalancerIngress model in your client version (20.0.1). When the Kubernetes API includes ipMode in its response (like {"ip": "10.217.127.235", "ipMode": "VIP"}), the Java client library throws an exception due to the unexpected field. Are similar issues expected when we use client version which mentions "-" in the compatibility matrix?

@brendandburns
Copy link
Contributor

Yes, that is expected. 20.x was built with the 1.29 API spec. Though it will mostly work, there are places where there may be incompatabilities because fields were added or removed, this is such a case.

Please try the 21.x release which was built with the 1.30 API Spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants